merge
authoralfadur
Sun, 14 Oct 2018 09:43:42 -0400
changeset 13896 ac1801fe51d9
parent 13895 353c999b1558 (current diff)
parent 13890 2a3d119b9fe9 (diff)
child 13897 1d4291eccb5f
merge
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);