Skip to content

Commit d43cdfd

Browse files
committed
---
yaml --- r: 59387 b: refs/heads/snap-stage3 c: 314b485 h: refs/heads/master i: 59385: 07fc4cb 59383: 9217983 v: v3
1 parent 4efd2f3 commit d43cdfd

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 06c5e7f383405094ab95229da7854aa61bb9df7f
4+
refs/heads/snap-stage3: 314b485c9c480c4a7f47c28716e629d642e2d412
55
refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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)