Skip to content

Commit 829c4f8

Browse files
authored
Remove usage of the to-be-deprecated core::f32, core::f64 items
Needed for rust-lang/rust#146882.
1 parent ee959d7 commit 829c4f8

File tree

13 files changed

+9
-35
lines changed

13 files changed

+9
-35
lines changed

libm-test/src/precision.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! Configuration for skipping or changing the result for individual test cases (inputs) rather
22
//! than ignoring entire tests.
33
4-
use core::f32;
5-
64
use CheckBasis::{Mpfr, Musl};
75
use libm::support::CastFrom;
86
use {BaseName as Bn, Identifier as Id};

libm/src/math/atan.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
* to produce the hexadecimal values shown.
3030
*/
3131

32-
use core::f64;
33-
3432
use super::fabs;
3533

3634
const ATANHI: [f64; 4] = [
@@ -134,19 +132,19 @@ pub fn atan(x: f64) -> f64 {
134132

135133
#[cfg(test)]
136134
mod tests {
137-
use core::f64;
135+
use core::f64::consts;
138136

139137
use super::atan;
140138

141139
#[test]
142140
fn sanity_check() {
143141
for (input, answer) in [
144-
(3.0_f64.sqrt() / 3.0, f64::consts::FRAC_PI_6),
145-
(1.0, f64::consts::FRAC_PI_4),
146-
(3.0_f64.sqrt(), f64::consts::FRAC_PI_3),
147-
(-3.0_f64.sqrt() / 3.0, -f64::consts::FRAC_PI_6),
148-
(-1.0, -f64::consts::FRAC_PI_4),
149-
(-3.0_f64.sqrt(), -f64::consts::FRAC_PI_3),
142+
(3.0_f64.sqrt() / 3.0, consts::FRAC_PI_6),
143+
(1.0, consts::FRAC_PI_4),
144+
(3.0_f64.sqrt(), consts::FRAC_PI_3),
145+
(-3.0_f64.sqrt() / 3.0, -consts::FRAC_PI_6),
146+
(-1.0, -consts::FRAC_PI_4),
147+
(-3.0_f64.sqrt(), -consts::FRAC_PI_3),
150148
]
151149
.iter()
152150
{
@@ -167,12 +165,12 @@ mod tests {
167165

168166
#[test]
169167
fn infinity() {
170-
assert_eq!(atan(f64::INFINITY), f64::consts::FRAC_PI_2);
168+
assert_eq!(atan(f64::INFINITY), consts::FRAC_PI_2);
171169
}
172170

173171
#[test]
174172
fn minus_infinity() {
175-
assert_eq!(atan(f64::NEG_INFINITY), -f64::consts::FRAC_PI_2);
173+
assert_eq!(atan(f64::NEG_INFINITY), -consts::FRAC_PI_2);
176174
}
177175

178176
#[test]

libm/src/math/cbrtf.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* Return cube root of x
1818
*/
1919

20-
use core::f32;
21-
2220
const B1: u32 = 709958130; /* B1 = (127-127.0/3-0.03306235651)*2**23 */
2321
const B2: u32 = 642849266; /* B2 = (127-127.0/3-24/3-0.03306235651)*2**23 */
2422

libm/src/math/expm1.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* ====================================================
1111
*/
1212

13-
use core::f64;
14-
1513
const O_THRESHOLD: f64 = 7.09782712893383973096e+02; /* 0x40862E42, 0xFEFA39EF */
1614
const LN2_HI: f64 = 6.93147180369123816490e-01; /* 0x3fe62e42, 0xfee00000 */
1715
const LN2_LO: f64 = 1.90821492927058770002e-10; /* 0x3dea39ef, 0x35793c76 */

libm/src/math/hypot.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use core::f64;
2-
31
use super::sqrt;
42

53
const SPLIT: f64 = 134217728. + 1.; // 0x1p27 + 1 === (2 ^ 27) + 1

libm/src/math/hypotf.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use core::f32;
2-
31
use super::sqrtf;
42

53
#[cfg_attr(assert_no_panic, no_panic::no_panic)]

libm/src/math/log10.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* log10(x) = (f - f*f/2 + r)/log(10) + k*log10(2)
1818
*/
1919

20-
use core::f64;
21-
2220
const IVLN10HI: f64 = 4.34294481878168880939e-01; /* 0x3fdbcb7b, 0x15200000 */
2321
const IVLN10LO: f64 = 2.50829467116452752298e-11; /* 0x3dbb9438, 0xca9aadd5 */
2422
const LOG10_2HI: f64 = 3.01029995663611771306e-01; /* 0x3FD34413, 0x509F6000 */

libm/src/math/log10f.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
* See comments in log10.c.
1414
*/
1515

16-
use core::f32;
17-
1816
const IVLN10HI: f32 = 4.3432617188e-01; /* 0x3ede6000 */
1917
const IVLN10LO: f32 = -3.1689971365e-05; /* 0xb804ead9 */
2018
const LOG10_2HI: f32 = 3.0102920532e-01; /* 0x3e9a2080 */

libm/src/math/log1p.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@
5353
* See HP-15C Advanced Functions Handbook, p.193.
5454
*/
5555

56-
use core::f64;
57-
5856
const LN2_HI: f64 = 6.93147180369123816490e-01; /* 3fe62e42 fee00000 */
5957
const LN2_LO: f64 = 1.90821492927058770002e-10; /* 3dea39ef 35793c76 */
6058
const LG1: f64 = 6.666666666666735130e-01; /* 3FE55555 55555593 */

libm/src/math/log1pf.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* ====================================================
1111
*/
1212

13-
use core::f32;
14-
1513
const LN2_HI: f32 = 6.9313812256e-01; /* 0x3f317180 */
1614
const LN2_LO: f32 = 9.0580006145e-06; /* 0x3717f7d1 */
1715
/* |(log(1+s)-log(1-s))/s - Lg(s)| < 2**-34.24 (~[-4.95e-11, 4.97e-11]). */

0 commit comments

Comments
 (0)