]>
git.proxmox.com Git - rustc.git/blob - vendor/compiler_builtins/libm/src/math/round.rs
3 const TOINT
: f64 = 1.0 / f64::EPSILON
;
5 #[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
6 pub fn round(mut x
: f64) -> f64 {
8 let e
: u64 = i
>> 52 & 0x7ff;
15 // raise inexact if x!=0
16 force_eval
!(x
+ TOINT
);
22 y
= x
+ TOINT
- TOINT
- x
;
44 assert_eq
!(round(-0.0_f64).to_bits(), (-0.0_f64).to_bits());