The Rust team announced the release of Rust 1.98.0. This version introduces several new features and improvements for the programming language, which focuses on building reliable and efficient software. Users can update their existing Rust installations via `rustup update stable`.
Floating-point types `f32` and `f64` now include "algebraic" methods for addition, subtraction, multiplication, division, and remainder. These methods enable the compiler to apply optimizations based on the algebraic properties of real numbers, even though floating-point representations have limitations. This can lead to reordering of operations, potentially allowing for broader loop-vectorization.
These algebraic methods are non-deterministic, meaning the compiler can choose different optimization strategies, but they are guaranteed not to cause undefined behavior. This feature is similar to the `-ffast-math` option found in other languages.
All primitive integer types now have a `format_into` method. This method takes a `&mut NumBuffer<Self>` parameter, which is a buffer sized to hold the decimal format of any value of that type. The method returns a formatted `&str` with a lifetime borrowed from the buffer.
The `format_into` method bypasses much of the dynamic dispatch typically involved with buffered `write!` formatting, resulting in performance gains. Benchmarks indicate that `format_into` performs similarly to the `itoa` crate, positioning it as a potential standard replacement for that dependency.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
The Rust team released version 1.98.0, introducing new "algebraic" methods for floating-point operations and a `format_into` method for buffered integer formatting. These updates provide developers with more control over floating-point optimizations and offer performance improvements for integer formatting.