Rust 1.98 Adds Algebraic Floats for Faster Number Crunching
Rust 1.98 Adds Algebraic Floats for Faster Number Crunching Rust 1.98 landed on August 20, and it quietly settles a two-decade-old argument. The language now has algebraic floating-point methods — an opt-in way to let the compiler reorder float math for speed, similar to what -ffast-math gives C and C++. If you build or maintain any performance-sensitive tooling, this is worth ten minutes of your time. [!TIP] Already on rustup? rustup update stable is the whole upgrade process. Why Rust 1.98's Algebraic Floats Matter Here's the background in one paragraph. Floating-point addition isn't associative — (a + b) + c and a + (b + c) can produce slightly different results. So by default, compilers must evaluate a + b + c + d strictly left to right, one operation at a time. C and C++ compilers have long offered -ffast-math to say "relax, reorder things, vectorize" — fast, but famously dangerous because it applies globally and can silently break code that depe...