Commit a809ed4 1 parent 073982e commit a809ed4 Copy full SHA for a809ed4
File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ use super::super::{CastInto, Float};
6
6
pub fn ceil < F : Float > ( x : F ) -> F {
7
7
let toint = F :: ONE / F :: EPSILON ;
8
8
9
- let e = x. exp_unbiased ( ) ;
9
+ let e = x. exp ( ) ;
10
10
let y: F ;
11
11
12
12
// If the exponent exceeds
13
- if e >= F :: SIG_BITS . cast ( ) || x == F :: ZERO {
13
+ if e >= ( F :: SIG_BITS + F :: EXP_BIAS ) . cast ( ) || x == F :: ZERO {
14
14
return x;
15
15
}
16
16
@@ -21,7 +21,7 @@ pub fn ceil<F: Float>(x: F) -> F {
21
21
y = if neg { x - toint + toint - x } else { x + toint - toint - x } ;
22
22
23
23
// special case because of non-nearest rounding modes
24
- if e < 0 {
24
+ if e < F :: EXP_BIAS . cast ( ) {
25
25
// Raise `FE_INEXACT`
26
26
force_eval ! ( y) ;
27
27
return if neg { F :: NEG_ZERO } else { F :: ONE } ;
You can’t perform that action at this time.
0 commit comments