From 9c4332e2860dccc6c58645cf4ebce280416c872c Mon Sep 17 00:00:00 2001 From: Igor null Date: Tue, 16 Oct 2018 10:26:39 +0300 Subject: [PATCH] fixed uint underflow in floorf for negative exponents --- src/math/floorf.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math/floorf.rs b/src/math/floorf.rs index 8699be0..7d631df 100644 --- a/src/math/floorf.rs +++ b/src/math/floorf.rs @@ -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;