about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrendan Zabarauskas <bjzaba@yahoo.com.au>2013-05-07 14:35:01 +1000
committerBrendan Zabarauskas <bjzaba@yahoo.com.au>2013-05-07 19:16:03 +1000
commit314b485c9c480c4a7f47c28716e629d642e2d412 (patch)
tree9d26c0e7ae83ca854f6453e5efe99dc0227a4f57
parent06c5e7f383405094ab95229da7854aa61bb9df7f (diff)
downloadrust-314b485c9c480c4a7f47c28716e629d642e2d412.tar.gz
rust-314b485c9c480c4a7f47c28716e629d642e2d412.zip
Fix order of methods
-rw-r--r--src/libcore/num/f32.rs25
-rw-r--r--src/libcore/num/float.rs25
2 files changed, 26 insertions, 24 deletions
diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs
index 58dc6f4f45b..580a612aebb 100644
--- a/src/libcore/num/f32.rs
+++ b/src/libcore/num/f32.rs
@@ -551,9 +551,22 @@ impl Float for f32 {
     #[inline(always)]
     fn neg_zero() -> f32 { -0.0 }
 
+    /// Returns `true` if the number is NaN
     #[inline(always)]
     fn is_NaN(&self) -> bool { *self != *self }
 
+    /// Returns `true` if the number is infinite
+    #[inline(always)]
+    fn is_infinite(&self) -> bool {
+        *self == Float::infinity() || *self == Float::neg_infinity()
+    }
+
+    /// Returns `true` if the number is not infinite or NaN
+    #[inline(always)]
+    fn is_finite(&self) -> bool {
+        !(self.is_NaN() || self.is_infinite())
+    }
+
     #[inline(always)]
     fn mantissa_digits() -> uint { 24 }
 
@@ -575,18 +588,6 @@ impl Float for f32 {
     #[inline(always)]
     fn max_10_exp() -> int { 38 }
 
-    /// Returns `true` if the number is infinite
-    #[inline(always)]
-    fn is_infinite(&self) -> bool {
-        *self == Float::infinity() || *self == Float::neg_infinity()
-    }
-
-    /// Returns `true` if the number is finite
-    #[inline(always)]
-    fn is_finite(&self) -> bool {
-        !(self.is_NaN() || self.is_infinite())
-    }
-
     ///
     /// Returns the exponential of the number, minus `1`, in a way that is accurate
     /// even if the number is close to zero
diff --git a/src/libcore/num/float.rs b/src/libcore/num/float.rs
index 512d3afc2b6..95f3a76b800 100644
--- a/src/libcore/num/float.rs
+++ b/src/libcore/num/float.rs
@@ -784,9 +784,22 @@ impl Float for float {
     #[inline(always)]
     fn neg_zero() -> float { -0.0 }
 
+    /// Returns `true` if the number is NaN
     #[inline(always)]
     fn is_NaN(&self) -> bool { *self != *self }
 
+    /// Returns `true` if the number is infinite
+    #[inline(always)]
+    fn is_infinite(&self) -> bool {
+        *self == Float::infinity() || *self == Float::neg_infinity()
+    }
+
+    /// Returns `true` if the number is not infinite or NaN
+    #[inline(always)]
+    fn is_finite(&self) -> bool {
+        !(self.is_NaN() || self.is_infinite())
+    }
+
     #[inline(always)]
     fn mantissa_digits() -> uint { Float::mantissa_digits::<f64>() }
 
@@ -808,18 +821,6 @@ impl Float for float {
     #[inline(always)]
     fn max_10_exp() -> int { Float::max_10_exp::<f64>() }
 
-    /// Returns `true` if the number is infinite
-    #[inline(always)]
-    fn is_infinite(&self) -> bool {
-        *self == Float::infinity() || *self == Float::neg_infinity()
-    }
-
-    /// Returns `true` if the number is finite
-    #[inline(always)]
-    fn is_finite(&self) -> bool {
-        !(self.is_NaN() || self.is_infinite())
-    }
-
     ///
     /// Returns the exponential of the number, minus `1`, in a way that is accurate
     /// even if the number is close to zero