fmt
cargo devel CI / cargo CI (push) Failing after 22s Details

This commit is contained in:
Christoph J. Scherr 2024-02-16 16:15:15 +01:00
parent 11e51495d5
commit 50206f1729
Signed by: cscherrNT
GPG Key ID: 8E2B45BC51A27EA7
3 changed files with 3 additions and 24 deletions

View File

@ -1,9 +1,5 @@
use std::iter::zip; use std::iter::zip;
// is n about the same as m? // is n about the same as m?
// This is actually not so easy! How do you measure "about same"ness? // This is actually not so easy! How do you measure "about same"ness?
// Also, it is not transitive, as 1 ≈ 1.1 ≈ 1.2 ≈ 1.3 ≈ ... ≈ 2 ≈ ... ≈ 3 ≈ ... ≈ infinity, that's // Also, it is not transitive, as 1 ≈ 1.1 ≈ 1.2 ≈ 1.3 ≈ ... ≈ 2 ≈ ... ≈ 3 ≈ ... ≈ infinity, that's
@ -35,14 +31,7 @@ fn test_calc_regular_rsqrt() {
#[test] #[test]
fn test_calc_specific_fast_rsqrt() { fn test_calc_specific_fast_rsqrt() {
let params: &[f32] = &[1.0, 1.1, 100.0, 1337.0, 123.456_79, 1337.1337]; let params: &[f32] = &[1.0, 1.1, 100.0, 1337.0, 123.456_79, 1337.1337];
let results: &[f32] = &[ let results: &[f32] = &[1.0, 0.953_462_6, 0.1, 0.027_348_55, 0.09, 0.027_347_183];
1.0,
0.953_462_6,
0.1,
0.027_348_55,
0.09,
0.027_347_183,
];
for (n, m) in zip(params, results) { for (n, m) in zip(params, results) {
assert!(about_same(revsqrt::fast_inverse_sqrt(*n), *m)) assert!(about_same(revsqrt::fast_inverse_sqrt(*n), *m))
} }
@ -51,14 +40,7 @@ fn test_calc_specific_fast_rsqrt() {
#[test] #[test]
fn test_calc_specific_reqular_rsqrt() { fn test_calc_specific_reqular_rsqrt() {
let params: &[f32] = &[1.0, 1.1, 100.0, 1337.0, 123.456_79, 1337.1337]; let params: &[f32] = &[1.0, 1.1, 100.0, 1337.0, 123.456_79, 1337.1337];
let results: &[f32] = &[ let results: &[f32] = &[1.0, 0.953_462_6, 0.1, 0.027_348_55, 0.09, 0.027_347_183];
1.0,
0.953_462_6,
0.1,
0.027_348_55,
0.09,
0.027_347_183,
];
for (n, m) in zip(params, results) { for (n, m) in zip(params, results) {
assert_eq!(revsqrt::regular_inverse_sqrt(*n), *m) assert_eq!(revsqrt::regular_inverse_sqrt(*n), *m)
} }

View File

@ -1,10 +1,7 @@
use std::iter::zip; use std::iter::zip;
use cucumber::{gherkin::Step, given, then, when, World}; use cucumber::{gherkin::Step, given, then, when, World};
/// stores the current information for each scenario /// stores the current information for each scenario
#[derive(Debug, Default, World)] #[derive(Debug, Default, World)]
struct NumWorld { struct NumWorld {

View File

@ -1,4 +1,4 @@
use std::{ sync::Arc}; use std::sync::Arc;
use tokio::{net::TcpListener, sync::Mutex}; use tokio::{net::TcpListener, sync::Mutex};