upgrade cargo dependencies
This commit is contained in:
@@ -502,21 +502,29 @@ fn test_extrema_and_roots_with_trig() {
|
||||
let extrema_x: Vec<f32> = function.extrema_data.iter().map(|p| p.x as f32).collect();
|
||||
|
||||
// Should have extrema near ±π/2
|
||||
assert!(extrema_x
|
||||
.iter()
|
||||
.any(|&x| emath::almost_equal(x, std::f32::consts::PI / 2.0, 0.1)));
|
||||
assert!(extrema_x
|
||||
.iter()
|
||||
.any(|&x| emath::almost_equal(x, -std::f32::consts::PI / 2.0, 0.1)));
|
||||
assert!(
|
||||
extrema_x
|
||||
.iter()
|
||||
.any(|&x| emath::almost_equal(x, std::f32::consts::PI / 2.0, 0.1))
|
||||
);
|
||||
assert!(
|
||||
extrema_x
|
||||
.iter()
|
||||
.any(|&x| emath::almost_equal(x, -std::f32::consts::PI / 2.0, 0.1))
|
||||
);
|
||||
|
||||
let roots_x: Vec<f32> = function.root_data.iter().map(|p| p.x as f32).collect();
|
||||
|
||||
assert!(roots_x
|
||||
.iter()
|
||||
.any(|&x| emath::almost_equal(x, std::f32::consts::PI, 0.1)));
|
||||
assert!(roots_x
|
||||
.iter()
|
||||
.any(|&x| emath::almost_equal(x, -std::f32::consts::PI, 0.1)));
|
||||
assert!(
|
||||
roots_x
|
||||
.iter()
|
||||
.any(|&x| emath::almost_equal(x, std::f32::consts::PI, 0.1))
|
||||
);
|
||||
assert!(
|
||||
roots_x
|
||||
.iter()
|
||||
.any(|&x| emath::almost_equal(x, -std::f32::consts::PI, 0.1))
|
||||
);
|
||||
|
||||
assert!(roots_x.iter().any(|&x| emath::almost_equal(x, 0.0, 0.1)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user