Rust 1.98 Brings New Floating-Point Optimization Features
The Rust team has announced Rust 1.98, the latest stable version of the popular systems programming language, introducing new algebraic floating-point methods, faster buffered integer formatting, and a broad selection of newly stabilized standard library APIs. One of the most notable additions is a new…
The Rust team has announced Rust 1.98, the latest stable version of the popular systems programming language, introducing new algebraic floating-point methods, faster buffered integer formatting, and a broad selection of newly stabilized standard library APIs. One of the most notable additions is a.
These cover addition, subtraction, multiplication, division, and remainder operations, allowing the compiler to perform optimizations based on the algebraic properties of real numbers even when those properties do not strictly hold for floating-point representations. This gives the compiler more freedom to reorder floating-point operations.
What Happened
The Rust team compares these optimizations to those enabled by options like -ffast-math in other languages, although the exact set is intentionally unspecified. For example, a normal expression such as a + b + c + d must retain its left-associative evaluation.
With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.
Bobby Borisov Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience.
As usual, existing Rust users can upgrade through rustup by running rustup update stable.
Key Details
When the same calculation is expressed using the new algebraic_add methods, however, the compiler is free to reorganize it, potentially evaluating partial sums in parallel. Rust 1.98 also introduces a new format_into method for all primitive integer types.
For additional details, see the announcement.
The new strip_circumfix method has also been stabilized for both strings and slices.
String handling also sees several additions, including String::from_utf16le, String::from_utf16be, and their lossy counterparts for converting explicitly little-endian and big-endian UTF-16 data.
Why It Matters
The formatted result is returned as a string slice borrowing from that buffer.
It works with the newly stabilized NumBuffer type, which provides enough storage for the decimal representation of any value of the corresponding integer type.
What Reports Say
Coverage of the story so far points to:
Continued reporting by Linuxiac as more details emerge