moar revsqrt basic tests
Cargo Check, Format, Fix and Test / cargo CI (push) Successful in 2m12s
Details
Cargo Check, Format, Fix and Test / cargo CI (push) Successful in 2m12s
Details
This commit is contained in:
parent
14263cd6b2
commit
3c7a4297f5
|
@ -62,7 +62,10 @@ Feature: inverted square root calculation
|
||||||
Given the number n
|
Given the number n
|
||||||
| n |
|
| n |
|
||||||
| 1 |
|
| 1 |
|
||||||
|
| 0.9 |
|
||||||
| 1.0001 |
|
| 1.0001 |
|
||||||
|
| 1.1001 |
|
||||||
|
| 1.1050 |
|
||||||
| 0.999 |
|
| 0.999 |
|
||||||
| 0.9999999999 |
|
| 0.9999999999 |
|
||||||
Then they are about the same
|
Then they are about the same
|
||||||
|
|
|
@ -14,10 +14,10 @@ pub struct NumWorld {
|
||||||
// a thought of me at least?
|
// a thought of me at least?
|
||||||
#[inline]
|
#[inline]
|
||||||
fn about_same(n: f32, m: f32) -> bool {
|
fn about_same(n: f32, m: f32) -> bool {
|
||||||
dbg!((n, m));
|
// dbg!((n, m));
|
||||||
dbg!((n - m).abs());
|
// dbg!((n - m).abs());
|
||||||
dbg!(calc_gate(n, m));
|
// dbg!(calc_gate(n, m));
|
||||||
dbg!((n - m).abs() < calc_gate(n, m));
|
// dbg!((n - m).abs() < calc_gate(n, m));
|
||||||
(n - m).abs() <= calc_gate(n, m)
|
(n - m).abs() <= calc_gate(n, m)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue