Skip to content

Commit

Permalink
Remove negative numbers from test
Browse files Browse the repository at this point in the history
  • Loading branch information
ZagButNoZig committed Nov 16, 2022
1 parent 9f7020b commit 2075461
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/math/sqrt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ mod tests {

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

for i in 0..values.len() {
let bits = f64::to_bits(sqrt(values[i]));
Expand Down
6 changes: 3 additions & 3 deletions src/math/sqrtf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ mod tests {

#[test]
fn conformance_tests() {
let values = [3.14159265359f32, 10000.0f32, -1.0f32, INFINITY];
let results = [1071833029u32, 1120403456u32, 4290772992u32, 2139095040u32];
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);
Expand Down

0 comments on commit 2075461

Please sign in to comment.