This repository was archived by the owner on Apr 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +17
-19
lines changed Expand file tree Collapse file tree 4 files changed +17
-19
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,7 @@ mod musl_reference_tests {
26
26
27
27
// These files are all internal functions or otherwise miscellaneous, not
28
28
// defining a function we want to test.
29
- const IGNORED_FILES : & [ & str ] = & [
30
- "fenv.rs" ,
31
- ] ;
29
+ const IGNORED_FILES : & [ & str ] = & [ "fenv.rs" ] ;
32
30
33
31
struct Function {
34
32
name : String ,
Original file line number Diff line number Diff line change 1
- const FP_ILOGBNAN : i32 = -1 - ( ( ! 0 ) >> 1 ) ;
1
+ const FP_ILOGBNAN : i32 = -1 - 0x7fffffff ;
2
2
const FP_ILOGB0 : i32 = FP_ILOGBNAN ;
3
3
4
4
pub fn ilogb ( x : f64 ) -> i32 {
@@ -17,15 +17,15 @@ pub fn ilogb(x: f64) -> i32 {
17
17
e -= 1 ;
18
18
i <<= 1 ;
19
19
}
20
- return e;
21
- }
22
- if e == 0x7ff {
20
+ e
21
+ } else if e == 0x7ff {
23
22
force_eval ! ( 0.0 / 0.0 ) ;
24
23
if ( i << 12 ) != 0 {
25
- return FP_ILOGBNAN ;
24
+ FP_ILOGBNAN
26
25
} else {
27
- return i32:: max_value ( ) ;
26
+ i32:: max_value ( )
28
27
}
28
+ } else {
29
+ e - 0x3ff
29
30
}
30
- return e - 0x3ff ;
31
31
}
Original file line number Diff line number Diff line change 1
- const FP_ILOGBNAN : i32 = -1 - ( ( ! 0 ) >> 1 ) ;
1
+ const FP_ILOGBNAN : i32 = -1 - 0x7fffffff ;
2
2
const FP_ILOGB0 : i32 = FP_ILOGBNAN ;
3
3
4
4
pub fn ilogbf ( x : f32 ) -> i32 {
@@ -17,15 +17,15 @@ pub fn ilogbf(x: f32) -> i32 {
17
17
e -= 1 ;
18
18
i <<= 1 ;
19
19
}
20
- return e;
21
- }
22
- if e == 0xff {
20
+ e
21
+ } else if e == 0xff {
23
22
force_eval ! ( 0.0 / 0.0 ) ;
24
23
if ( i << 9 ) != 0 {
25
- return FP_ILOGBNAN ;
24
+ FP_ILOGBNAN
26
25
} else {
27
- return i32:: max_value ( ) ;
26
+ i32:: max_value ( )
28
27
}
28
+ } else {
29
+ e - 0x7f
29
30
}
30
- return e - 0x7f ;
31
31
}
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ pub fn jn(n: i32, mut x: f64) -> f64 {
54
54
ix &= 0x7fffffff ;
55
55
56
56
// -lx == !lx + 1
57
- if ( ix | ( lx | ( !lx + 1 ) ) >> 31 ) > 0x7ff00000 {
57
+ if ( ix | ( lx | ( ( !lx) . wrapping_add ( 1 ) ) ) >> 31 ) > 0x7ff00000 {
58
58
/* nan */
59
59
return x;
60
60
}
@@ -268,7 +268,7 @@ pub fn yn(n: i32, x: f64) -> f64 {
268
268
ix &= 0x7fffffff ;
269
269
270
270
// -lx == !lx + 1
271
- if ( ix | ( lx | ( !lx + 1 ) ) >> 31 ) > 0x7ff00000 {
271
+ if ( ix | ( lx | ( ( !lx) . wrapping_add ( 1 ) ) ) >> 31 ) > 0x7ff00000 {
272
272
/* nan */
273
273
return x;
274
274
}
You can’t perform that action at this time.
0 commit comments