Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
Forgot to run cargo fmt last time...
  • Loading branch information
ZagButNoZig committed Nov 16, 2022
1 parent 2075461 commit 415b0d0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
14 changes: 9 additions & 5 deletions src/math/sqrt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,20 @@ mod tests {
assert_eq!(sqrt(f), f);
}
}

#[test]
fn conformance_tests() {
let values = [3.14159265359, 10000.0, f64::from_bits(0x0000000f), INFINITY];
let results = [4610661241675116657u64, 4636737291354636288u64,
2197470602079456986u64, 9218868437227405312u64];

let results = [
4610661241675116657u64,
4636737291354636288u64,
2197470602079456986u64,
9218868437227405312u64,
];

for i in 0..values.len() {
let bits = f64::to_bits(sqrt(values[i]));
assert_eq!(results[i], bits);
}
}
}
}
13 changes: 9 additions & 4 deletions src/math/sqrtf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,20 @@ mod tests {
assert_eq!(sqrtf(f), f);
}
}
#[test]

#[test]
fn conformance_tests() {
let values = [3.14159265359f32, 10000.0f32, f32::from_bits(0x0000000f), INFINITY];
let values = [
3.14159265359f32,
10000.0f32,
f32::from_bits(0x0000000f),
INFINITY,
];
let results = [1071833029u32, 1120403456u32, 456082799u32, 2139095040u32];

for i in 0..values.len() {
let bits = f32::to_bits(sqrtf(values[i]));
assert_eq!(results[i], bits);
}
}
}
}

0 comments on commit 415b0d0

Please sign in to comment.