This repository was archived by the owner on Apr 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +10
-11
lines changed Expand file tree Collapse file tree 6 files changed +10
-11
lines changed Original file line number Diff line number Diff line change 206
206
},
207
207
"exp" : {
208
208
"sources" : [
209
- " src/math/exp.rs" ,
210
- " src/math/support/float_traits.rs"
209
+ " src/math/exp.rs"
211
210
],
212
211
"type" : " f64"
213
212
},
Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ where
249
249
let xy: B = x. widen ( ) * y. widen ( ) ;
250
250
let mut result: B = xy + z. widen ( ) ;
251
251
let mut ui: B :: Int = result. to_bits ( ) ;
252
- let re = result. exp ( ) ;
252
+ let re = result. ex ( ) ;
253
253
let zb: B = z. widen ( ) ;
254
254
255
255
let prec_diff = B :: SIG_BITS - F :: SIG_BITS ;
@@ -318,15 +318,15 @@ impl<F: Float> Norm<F> {
318
318
319
319
fn from_float ( x : F ) -> Self {
320
320
let mut ix = x. to_bits ( ) ;
321
- let mut e = x. exp ( ) as i32 ;
321
+ let mut e = x. ex ( ) as i32 ;
322
322
let neg = x. is_sign_negative ( ) ;
323
323
if e == 0 {
324
324
// Normalize subnormals by multiplication
325
325
let scale_i = F :: BITS - 1 ;
326
326
let scale_f = F :: from_parts ( false , scale_i + F :: EXP_BIAS , F :: Int :: ZERO ) ;
327
327
let scaled = x * scale_f;
328
328
ix = scaled. to_bits ( ) ;
329
- e = scaled. exp ( ) as i32 ;
329
+ e = scaled. ex ( ) as i32 ;
330
330
e = if e == 0 {
331
331
// If the exponent is still zero, the input was zero. Artifically set this value
332
332
// such that the final `e` will exceed `ZERO_INF_NAN`.
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ pub fn fmod<F: Float>(x: F, y: F) -> F {
9
9
let one = F :: Int :: ONE ;
10
10
let mut ix = x. to_bits ( ) ;
11
11
let mut iy = y. to_bits ( ) ;
12
- let mut ex = x. exp ( ) . signed ( ) ;
13
- let mut ey = y. exp ( ) . signed ( ) ;
12
+ let mut ex = x. ex ( ) . signed ( ) ;
13
+ let mut ey = y. ex ( ) . signed ( ) ;
14
14
let sx = ix & F :: SIGN_MASK ;
15
15
16
16
if iy << 1 == zero || y. is_nan ( ) || ex == F :: EXP_SAT as i32 {
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ use super::super::support::{FpResult, Round};
8
8
/// applicable.
9
9
pub fn rint_round < F : Float > ( x : F , _round : Round ) -> FpResult < F > {
10
10
let toint = F :: ONE / F :: EPSILON ;
11
- let e = x. exp ( ) ;
11
+ let e = x. ex ( ) ;
12
12
let positive = x. is_sign_positive ( ) ;
13
13
14
14
// On i386 `force_eval!` must be used to force rounding via storage to memory. Otherwise,
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ where
109
109
ix = scaled. to_bits ( ) ;
110
110
match top {
111
111
Exp :: Shifted ( ref mut v) => {
112
- * v = scaled. exp ( ) ;
112
+ * v = scaled. ex ( ) ;
113
113
* v = ( * v) . wrapping_sub ( F :: SIG_BITS ) ;
114
114
}
115
115
Exp :: NoShift ( ( ) ) => {
Original file line number Diff line number Diff line change @@ -128,13 +128,13 @@ pub trait Float:
128
128
}
129
129
130
130
/// Returns the exponent, not adjusting for bias, not accounting for subnormals or zero.
131
- fn exp ( self ) -> u32 {
131
+ fn ex ( self ) -> u32 {
132
132
u32:: cast_from ( self . to_bits ( ) >> Self :: SIG_BITS ) & Self :: EXP_SAT
133
133
}
134
134
135
135
/// Extract the exponent and adjust it for bias, not accounting for subnormals or zero.
136
136
fn exp_unbiased ( self ) -> i32 {
137
- self . exp ( ) . signed ( ) - ( Self :: EXP_BIAS as i32 )
137
+ self . ex ( ) . signed ( ) - ( Self :: EXP_BIAS as i32 )
138
138
}
139
139
140
140
/// Returns the significand with no implicit bit (or the "fractional" part)
You can’t perform that action at this time.
0 commit comments