changeset 13917 | ac1801fe51d9 |
parent 13911 | 9ae1184886db |
parent 13906 | 2a3d119b9fe9 |
child 13926 | fed924791e06 |
--- a/rust/fpnum/src/lib.rs Sun Oct 14 09:42:26 2018 -0400 +++ b/rust/fpnum/src/lib.rs Sun Oct 14 09:43:42 2018 -0400 @@ -328,6 +328,19 @@ } #[test] +fn ord() { + let z = FPNum::from(0);; + let n1_5 = FPNum::new(3, 2); + let n2_25 = FPNum::new(9, 4); + + assert!(!(z > z)); + assert!(!(z < z)); + assert!(n2_25 > n1_5); + assert!(-n2_25 < n1_5); + assert!(-n2_25 < -n1_5); +} + +#[test] fn arith() { let n1_5 = fp!(3/2); let n2_25 = fp!(9/4);