MCPcopy Create free account
hub / github.com/Axect/Peroxide / assert_close

Function assert_close

tests/jet_tests.rs:10–16  ·  view source on GitHub ↗
(actual: f64, expected: f64)

Source from the content-addressed store, hash-verified

8const EPS: f64 = 1e-10;
9
10fn assert_close(actual: f64, expected: f64) {
11 assert!(
12 (actual - expected).abs() < EPS,
13 "actual = {actual:.15e}, expected = {expected:.15e}, diff = {:.3e}",
14 (actual - expected).abs()
15 );
16}
17
18fn assert_close_eps(actual: f64, expected: f64, eps: f64) {
19 assert!(

Callers 15

test_jet_var_valueFunction · 0.70
test_jet_constantFunction · 0.70
test_jet_new_rawFunction · 0.70
test_ad0_constructorFunction · 0.70
test_ad1_constructorFunction · 0.70
test_AD0_constructorFunction · 0.70
test_AD1_constructorFunction · 0.70
test_AD2_constructorFunction · 0.70
test_derivative_accessorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected