Skip to content

Commit 0a04880

Browse files
committed
Add tests for cis function
1 parent 70564df commit 0a04880

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,15 @@ mod test {
16091609
use super::*;
16101610
use num_traits::{Float, Pow};
16111611

1612+
#[test]
1613+
fn test_cis() {
1614+
assert!(close(Complex::cis(0.0 * f64::consts::PI), _1_0i));
1615+
assert!(close(Complex::cis(0.5 * f64::consts::PI), _0_1i));
1616+
assert!(close(Complex::cis(1.0 * f64::consts::PI), -_1_0i));
1617+
assert!(close(Complex::cis(1.5 * f64::consts::PI), -_0_1i));
1618+
assert!(close(Complex::cis(2.0 * f64::consts::PI), _1_0i));
1619+
}
1620+
16121621
#[test]
16131622
#[cfg_attr(target_arch = "x86", ignore)]
16141623
// FIXME #7158: (maybe?) currently failing on x86.

0 commit comments

Comments
 (0)