Floating point math is often slower than integer math because the compiler is being conservative about how it optimizes your code. While some programming languages already had solutions of a sort, until now Rust did not have a good stable way to deal with this limitation. But now, starting in version 1.98, Rust will allow telling the compiler it can optimize your code further—but with extra control so that you can still write numeric algorithms with minimal rounding errors. In this article you will learn: Why by default the compiler won’t optimize floating point math as much as it does integer math. Rust’s new API to solve this limitation. Examples of using this new API, its speed impact, and how you can control where it is used. Summing integers is fast I’m going to start with an example using integers, as a baseline of what sort of performance is possible.…