Skip to content

Commit c412a59

Browse files
committed
---
yaml --- r: 140539 b: refs/heads/try2 c: 314b485 h: refs/heads/master i: 140537: af5b73c 140535: c547550 v: v3
1 parent 3c52687 commit c412a59

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 06c5e7f383405094ab95229da7854aa61bb9df7f
8+
refs/heads/try2: 314b485c9c480c4a7f47c28716e629d642e2d412
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/num/f32.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,22 @@ impl Float for f32 {
551551
#[inline(always)]
552552
fn neg_zero() -> f32 { -0.0 }
553553

554+
/// Returns `true` if the number is NaN
554555
#[inline(always)]
555556
fn is_NaN(&self) -> bool { *self != *self }
556557

558+
/// Returns `true` if the number is infinite
559+
#[inline(always)]
560+
fn is_infinite(&self) -> bool {
561+
*self == Float::infinity() || *self == Float::neg_infinity()
562+
}
563+
564+
/// Returns `true` if the number is not infinite or NaN
565+
#[inline(always)]
566+
fn is_finite(&self) -> bool {
567+
!(self.is_NaN() || self.is_infinite())
568+
}
569+
557570
#[inline(always)]
558571
fn mantissa_digits() -> uint { 24 }
559572

@@ -575,18 +588,6 @@ impl Float for f32 {
575588
#[inline(always)]
576589
fn max_10_exp() -> int { 38 }
577590

578-
/// Returns `true` if the number is infinite
579-
#[inline(always)]
580-
fn is_infinite(&self) -> bool {
581-
*self == Float::infinity() || *self == Float::neg_infinity()
582-
}
583-
584-
/// Returns `true` if the number is finite
585-
#[inline(always)]
586-
fn is_finite(&self) -> bool {
587-
!(self.is_NaN() || self.is_infinite())
588-
}
589-
590591
///
591592
/// Returns the exponential of the number, minus `1`, in a way that is accurate
592593
/// even if the number is close to zero

branches/try2/src/libcore/num/float.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -784,9 +784,22 @@ impl Float for float {
784784
#[inline(always)]
785785
fn neg_zero() -> float { -0.0 }
786786
787+
/// Returns `true` if the number is NaN
787788
#[inline(always)]
788789
fn is_NaN(&self) -> bool { *self != *self }
789790
791+
/// Returns `true` if the number is infinite
792+
#[inline(always)]
793+
fn is_infinite(&self) -> bool {
794+
*self == Float::infinity() || *self == Float::neg_infinity()
795+
}
796+
797+
/// Returns `true` if the number is not infinite or NaN
798+
#[inline(always)]
799+
fn is_finite(&self) -> bool {
800+
!(self.is_NaN() || self.is_infinite())
801+
}
802+
790803
#[inline(always)]
791804
fn mantissa_digits() -> uint { Float::mantissa_digits::<f64>() }
792805
@@ -808,18 +821,6 @@ impl Float for float {
808821
#[inline(always)]
809822
fn max_10_exp() -> int { Float::max_10_exp::<f64>() }
810823
811-
/// Returns `true` if the number is infinite
812-
#[inline(always)]
813-
fn is_infinite(&self) -> bool {
814-
*self == Float::infinity() || *self == Float::neg_infinity()
815-
}
816-
817-
/// Returns `true` if the number is finite
818-
#[inline(always)]
819-
fn is_finite(&self) -> bool {
820-
!(self.is_NaN() || self.is_infinite())
821-
}
822-
823824
///
824825
/// Returns the exponential of the number, minus `1`, in a way that is accurate
825826
/// even if the number is close to zero

0 commit comments

Comments
 (0)