Skip to content

Commit 344e352

Browse files
committed
Run rustfmt
1 parent 525a5b9 commit 344e352

File tree

8 files changed

+23
-24
lines changed

8 files changed

+23
-24
lines changed

build.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -267,22 +267,17 @@ mod musl_reference_tests {
267267
.status()
268268
.unwrap();
269269
assert!(status.success());
270-
let output = Command::new("./gen")
271-
.current_dir(&dst)
272-
.output()
273-
.unwrap();
270+
let output = Command::new("./gen").current_dir(&dst).output().unwrap();
274271
assert!(output.status.success());
275272
assert!(output.stderr.is_empty());
276273

277274
// Map all the output bytes back to an `i64` and then shove it all into
278275
// the expected results.
279-
let mut results =
280-
output.stdout.chunks_exact(8)
281-
.map(|buf| {
282-
let mut exact = [0; 8];
283-
exact.copy_from_slice(buf);
284-
i64::from_le_bytes(exact)
285-
});
276+
let mut results = output.stdout.chunks_exact(8).map(|buf| {
277+
let mut exact = [0; 8];
278+
exact.copy_from_slice(buf);
279+
i64::from_le_bytes(exact)
280+
});
286281

287282
for test in functions.iter_mut().flat_map(|f| f.tests.iter_mut()) {
288283
test.output = results.next().unwrap();
@@ -301,7 +296,10 @@ mod musl_reference_tests {
301296
src.push_str("fn ");
302297
src.push_str(&function.name);
303298
src.push_str("_matches_musl() {");
304-
src.push_str(&format!("static TESTS: &[([i64; {}], i64)]", function.args.len()));
299+
src.push_str(&format!(
300+
"static TESTS: &[([i64; {}], i64)]",
301+
function.args.len()
302+
));
305303
src.push_str(" = &[");
306304
for test in function.tests.iter() {
307305
src.push_str("([");
@@ -336,9 +334,11 @@ mod musl_reference_tests {
336334
Ty::Bool => unreachable!(),
337335
});
338336

339-
src.push_str(r#"
337+
src.push_str(
338+
r#"
340339
panic!("INPUT: {:?} EXPECTED: {:?} ACTUAL {:?}", test, expected, output);
341-
"#);
340+
"#,
341+
);
342342
src.push_str("}");
343343

344344
src.push_str("}");

src/math/atan.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ mod tests {
148148
(-3.0_f64.sqrt() / 3.0, -f64::consts::FRAC_PI_6),
149149
(-1.0, -f64::consts::FRAC_PI_4),
150150
(-3.0_f64.sqrt(), -f64::consts::FRAC_PI_3),
151-
].iter()
151+
]
152+
.iter()
152153
{
153154
assert!(
154155
(atan(*input) - answer) / answer < 1e-5,

src/math/expf.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const P2: f32 = -2.7667332906e-3; /* -0xb55215.0p-32 */
3131
pub fn expf(mut x: f32) -> f32 {
3232
let x1p127 = f32::from_bits(0x7f000000); // 0x1p127f === 2 ^ 127
3333
let x1p_126 = f32::from_bits(0x800000); // 0x1p-126f === 2 ^ -126 /*original 0x1p-149f ??????????? */
34-
3534
let mut hx = x.to_bits();
3635
let sign = (hx >> 31) as i32; /* sign bit of x */
3736
let signb: bool = sign != 0;

src/math/fma.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,13 @@ pub fn fma(x: f64, y: f64, z: f64) -> f64 {
166166
}
167167
if r == c {
168168
/* min normal after rounding, underflow depends
169-
on arch behaviour which can be imitated by
170-
a double to float conversion */
169+
on arch behaviour which can be imitated by
170+
a double to float conversion */
171171
let fltmin: f32 = (x0_ffffff8p_63 * f32::MIN_POSITIVE as f64 * r) as f32;
172172
return f64::MIN_POSITIVE / f32::MIN_POSITIVE as f64 * fltmin as f64;
173173
}
174174
/* one bit is lost when scaled, add another top bit to
175-
only round once at conversion if it is inexact */
175+
only round once at conversion if it is inexact */
176176
if (rhi << 53) != 0 {
177177
i = (rhi >> 1 | (rhi & 1) | 1 << 62) as i64;
178178
if sign != 0 {
@@ -182,7 +182,7 @@ pub fn fma(x: f64, y: f64, z: f64) -> f64 {
182182
r = 2. * r - c; /* remove top bit */
183183

184184
/* raise underflow portably, such that it
185-
cannot be optimized away */
185+
cannot be optimized away */
186186
{
187187
let tiny: f64 = f64::MIN_POSITIVE / f32::MIN_POSITIVE as f64 * r;
188188
r += (tiny * tiny) * (r - r);

src/math/pow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ pub fn pow(x: f64, y: f64) -> f64 {
262262
}
263263

264264
/* now |1-x| is TINY <= 2**-20, suffice to compute
265-
log(x) by x-x^2/2+x^3/3-x^4/4 */
265+
log(x) by x-x^2/2+x^3/3-x^4/4 */
266266
let t: f64 = ax - 1.0; /* t has 20 trailing zeros */
267267
let w: f64 = (t * t) * (0.5 - t * (0.3333333333333333333333 - t * 0.25));
268268
let u: f64 = IVLN2_H * t; /* ivln2_h has 21 sig. bits */

src/math/powf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ pub fn powf(x: f32, y: f32) -> f32 {
198198
}
199199

200200
/* now |1-x| is TINY <= 2**-20, suffice to compute
201-
log(x) by x-x^2/2+x^3/3-x^4/4 */
201+
log(x) by x-x^2/2+x^3/3-x^4/4 */
202202
t = ax - 1.; /* t has 20 trailing zeros */
203203
w = (t * t) * (0.5 - t * (0.333333333333 - t * 0.25));
204204
u = IVLN2_H * t; /* IVLN2_H has 16 sig. bits */

src/math/rem_pio2.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
// ====================================================
1111
//
1212
// Optimized by Bruce D. Evans. */
13-
1413
use super::rem_pio2_large;
1514

1615
// #if FLT_EVAL_METHOD==0 || FLT_EVAL_METHOD==1

src/math/scalbn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn scalbn(x: f64, mut n: i32) -> f64 {
1919
}
2020
} else if n < -1022 {
2121
/* make sure final n < -53 to avoid double
22-
rounding in the subnormal range */
22+
rounding in the subnormal range */
2323
y *= x1p_1022 * x1p53;
2424
n += 1022 - 53;
2525
if n < -1022 {

0 commit comments

Comments
 (0)