Skip to content

Commit

Permalink
Refine test for corner cases for cln (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Expander authored Nov 25, 2024
1 parent 9999dea commit fe749f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cln.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ fn test_cln() {
let rzero64 = 0.0_f64;

assert!(Complex::new( rzero32, rzero32).cln() == Complex::new(std::f32::NEG_INFINITY, 0.0));
assert!(Complex::new(-rzero32, rzero32).cln() == Complex::new(std::f32::NEG_INFINITY, std::f32::consts::PI));
assert!(Complex::new(-rzero32, rzero32).cln().re == std::f32::NEG_INFINITY);
assert!((Complex::new(-rzero32, rzero32).cln().im - std::f32::consts::PI).abs() < 4.0_f32*std::f32::EPSILON);
assert!(Complex::new( rzero64, rzero64).cln() == Complex::new(std::f64::NEG_INFINITY, 0.0));
assert!(Complex::new(-rzero64, rzero64).cln() == Complex::new(std::f64::NEG_INFINITY, std::f64::consts::PI));
}

0 comments on commit fe749f3

Please sign in to comment.