fixed uint underflow in floorf for negative exponents

This commit is contained in:
Igor null
2018-10-16 10:26:39 +03:00
committed by Alex Crichton
parent 69ded67c91
commit 9c4332e286
+1 -1
View File
@@ -12,7 +12,7 @@ pub fn floorf(x: f32) -> f32 {
}
}
let mut ui = x.to_bits();
let e = (((ui >> 23) & 0xff) - 0x7f) as i32;
let e = (((ui >> 23) as i32) & 0xff) - 0x7f;
if e >= 23 {
return x;