rust/fpnum/src/lib.rs
changeset 13960 665b4c6612ee
parent 13953 7bb60596c27e
child 14102 5d42204ac35e
--- a/rust/fpnum/src/lib.rs	Thu Oct 18 06:46:32 2018 +0300
+++ b/rust/fpnum/src/lib.rs	Thu Oct 18 06:50:21 2018 +0300
@@ -342,7 +342,7 @@
 
     #[inline]
     pub fn max_norm(&self) -> FPNum {
-        std::cmp::max(self.x(), self.y())
+        std::cmp::max(self.x().abs(), self.y().abs())
     }
 
     #[inline]
@@ -574,4 +574,5 @@
     assert_eq!(n * p, p * n);
     assert_eq!(distance(4, 3), fp!(5));
     assert_eq!(p * fp!(-3), FPPoint::new(fp!(-3), fp!(6)));
+    assert_eq!(p.max_norm(), fp!(2));
 }
\ No newline at end of file