rust/fpnum/src/lib.rs
changeset 13896 ac1801fe51d9
parent 13891 9ae1184886db
parent 13890 2a3d119b9fe9
child 13905 fed924791e06
equal deleted inserted replaced
13895:353c999b1558 13896:ac1801fe51d9
   326     assert!(-n2_25 < n1_5);
   326     assert!(-n2_25 < n1_5);
   327     assert!(-n2_25 < -n1_5);
   327     assert!(-n2_25 < -n1_5);
   328 }
   328 }
   329 
   329 
   330 #[test]
   330 #[test]
       
   331 fn ord() {
       
   332     let z = FPNum::from(0);;
       
   333     let n1_5 = FPNum::new(3, 2);
       
   334     let n2_25 = FPNum::new(9, 4);
       
   335 
       
   336     assert!(!(z > z));
       
   337     assert!(!(z < z));
       
   338     assert!(n2_25 > n1_5);
       
   339     assert!(-n2_25 < n1_5);
       
   340     assert!(-n2_25 < -n1_5);
       
   341 }
       
   342 
       
   343 #[test]
   331 fn arith() {
   344 fn arith() {
   332     let n1_5 = fp!(3/2);
   345     let n1_5 = fp!(3/2);
   333     let n2_25 = fp!(9/4);
   346     let n2_25 = fp!(9/4);
   334     let n_0_15 = fp!(-15/100);
   347     let n_0_15 = fp!(-15/100);
   335 
   348