diff --git a/sub_crates/rmath/src/utils.rs b/sub_crates/rmath/src/utils.rs index e6cbcd9..a48ca1d 100644 --- a/sub_crates/rmath/src/utils.rs +++ b/sub_crates/rmath/src/utils.rs @@ -8,16 +8,16 @@ /// - If either number is NaN, returns `u32::MAX`. #[inline(always)] pub fn ulp_diff(a: f32, b: f32) -> u32 { - const TOP_BIT: u32 = 1 << 31; + const SIGN_BIT: u32 = 1 << 31; const INFINITY: u32 = 0x7f800000; let a = a.to_bits(); let b = b.to_bits(); - let a_sign = a & TOP_BIT; - let b_sign = b & TOP_BIT; - let a_abs = a & !TOP_BIT; - let b_abs = b & !TOP_BIT; + let a_sign = a & SIGN_BIT; + let b_sign = b & SIGN_BIT; + let a_abs = a & !SIGN_BIT; + let b_abs = b & !SIGN_BIT; if a_abs > INFINITY || b_abs > INFINITY { // NaNs always return maximum ulps apart.