# HG changeset patch # User alfadur # Date 1539524622 14400 # Node ID ac1801fe51d9bffb0240b43a393e93aa3bf6a048 # Parent 353c999b1558c8d0b7eddc38434a5de840b7abb9# Parent 2a3d119b9fe93094ba67ecd620fd877f2b0a7398 merge diff -r 353c999b1558 -r ac1801fe51d9 rust/fpnum/src/lib.rs --- 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);