author | alfadur |
Sun, 14 Oct 2018 09:43:42 -0400 | |
changeset 13917 | ac1801fe51d9 |
parent 13916 | 353c999b1558 (current diff) |
parent 13906 | 2a3d119b9fe9 (diff) |
child 13918 | 1d4291eccb5f |
--- 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);