|
1 | 1 | // FIXME(f16_f128): only tested on platforms that have symbols and aren't buggy |
2 | 2 | #![cfg(target_has_reliable_f128)] |
3 | 3 |
|
4 | | -use std::f128::consts; |
5 | | - |
6 | 4 | use super::{assert_approx_eq, assert_biteq}; |
7 | 5 |
|
8 | 6 | // Note these tolerances make sense around zero, but not for more extreme exponents. |
9 | 7 |
|
10 | 8 | /// Default tolerances. Works for values that should be near precise but not exact. Roughly |
11 | 9 | /// the precision carried by `100 * 100`. |
| 10 | +#[allow(unused)] |
12 | 11 | const TOL: f128 = 1e-12; |
13 | 12 |
|
14 | 13 | /// For operations that are near exact, usually not involving math of different |
15 | 14 | /// signs. |
| 15 | +#[allow(unused)] |
16 | 16 | const TOL_PRECISE: f128 = 1e-28; |
17 | 17 |
|
18 | 18 | /// First pattern over the mantissa |
@@ -52,23 +52,6 @@ fn test_max_recip() { |
52 | 52 | ); |
53 | 53 | } |
54 | 54 |
|
55 | | -#[test] |
56 | | -fn test_to_radians() { |
57 | | - let pi: f128 = consts::PI; |
58 | | - let nan: f128 = f128::NAN; |
59 | | - let inf: f128 = f128::INFINITY; |
60 | | - let neg_inf: f128 = f128::NEG_INFINITY; |
61 | | - assert_biteq!(0.0f128.to_radians(), 0.0); |
62 | | - assert_approx_eq!(154.6f128.to_radians(), 2.6982790235832334267135442069489767804, TOL); |
63 | | - assert_approx_eq!((-332.31f128).to_radians(), -5.7999036373023566567593094812182763013, TOL); |
64 | | - // check approx rather than exact because round trip for pi doesn't fall on an exactly |
65 | | - // representable value (unlike `f32` and `f64`). |
66 | | - assert_approx_eq!(180.0f128.to_radians(), pi, TOL_PRECISE); |
67 | | - assert!(nan.to_radians().is_nan()); |
68 | | - assert_biteq!(inf.to_radians(), inf); |
69 | | - assert_biteq!(neg_inf.to_radians(), neg_inf); |
70 | | -} |
71 | | - |
72 | 55 | #[test] |
73 | 56 | fn test_float_bits_conv() { |
74 | 57 | assert_eq!((1f128).to_bits(), 0x3fff0000000000000000000000000000); |
|
0 commit comments