rust/library
bors 0a3b557d52 Auto merge of #95317 - Jules-Bertholet:round_ties_to_even, r=pnkfelix,m-ou-se,scottmcm
Add `round_ties_even` to `f32` and `f64`

Tracking issue: #96710

Redux of #82273. See also #55107

Adds a new method, `round_ties_even`, to `f32` and `f64`, that rounds the float to the nearest integer , rounding halfway cases to the number with an even least significant bit. Uses the `roundeven` LLVM intrinsic to do this.

Of the five IEEE 754 rounding modes, this is the only one that doesn't already have a round-to-integer function exposed by Rust (others are `round`, `floor`, `ceil`, and `trunc`).  Ties-to-even is also the rounding mode used for int-to-float and float-to-float `as` casts, as well as float arithmentic operations. So not having an explicit rounding method for it seems like an oversight.

Bikeshed: this PR currently uses `round_ties_even` for the name of the method. But maybe `round_ties_to_even` is better, or `round_even`, or `round_to_even`?
2023-03-07 09:43:12 +00:00
..
alloc Rollup merge of #108660 - xfix:remove-ne-method-from-str, r=thomcc 2023-03-04 15:24:39 +05:30
backtrace@07872f28cd Update backtrace 2022-09-02 16:09:58 -04:00
core Auto merge of #95317 - Jules-Bertholet:round_ties_to_even, r=pnkfelix,m-ou-se,scottmcm 2023-03-07 09:43:12 +00:00
panic_abort Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
panic_unwind Replace libstd, libcore, liballoc in docs. 2022-12-30 14:00:40 +01:00
portable-simd Match unmatched backticks in library/ 2023-03-03 03:03:29 +01:00
proc_macro Auto merge of #105671 - lukas-code:depreciate-char, r=scottmcm 2023-02-12 11:09:06 +00:00
profiler_builtins Fully stabilize NLL 2022-06-03 17:16:41 -04:00
rtstartup Remove custom frame info registration on i686-pc-windows-gnu 2022-08-23 16:12:58 +08:00
rustc-std-workspace-alloc Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
rustc-std-workspace-core
rustc-std-workspace-std
std Auto merge of #95317 - Jules-Bertholet:round_ties_to_even, r=pnkfelix,m-ou-se,scottmcm 2023-03-07 09:43:12 +00:00
stdarch@a0c30f3e3c update stdarch 2022-12-29 11:22:13 +01:00
test Match unmatched backticks in library/ 2023-03-03 03:03:29 +01:00
unwind Match unmatched backticks in library/ 2023-03-03 03:03:29 +01:00