Skip to content

Commit 9c4332e

Browse files
m1elalexcrichton
authored andcommitted
fixed uint underflow in floorf for negative exponents
1 parent 69ded67 commit 9c4332e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/math/floorf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub fn floorf(x: f32) -> f32 {
1212
}
1313
}
1414
let mut ui = x.to_bits();
15-
let e = (((ui >> 23) & 0xff) - 0x7f) as i32;
15+
let e = (((ui >> 23) as i32) & 0xff) - 0x7f;
1616

1717
if e >= 23 {
1818
return x;

0 commit comments

Comments
 (0)