Skip to content

Commit 13e9ef6

Browse files
committed
---
yaml --- r: 22094 b: refs/heads/snap-stage3 c: a08919a h: refs/heads/master v: v3
1 parent b144df1 commit 13e9ef6

File tree

5 files changed

+137
-145
lines changed

5 files changed

+137
-145
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: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: dd80cb22e3591267882136d8d5529dc92f049952
4+
refs/heads/snap-stage3: a08919a52273e8fdeb044e43be16c72915760035
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libcore/char.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ export is_alphabetic,
4747
to_digit, cmp,
4848
escape_default, escape_unicode;
4949

50-
use is_alphabetic = unicode::derived_property::Alphabetic;
51-
use is_XID_start = unicode::derived_property::XID_Start;
52-
use is_XID_continue = unicode::derived_property::XID_Continue;
50+
pub use is_alphabetic = unicode::derived_property::Alphabetic;
51+
pub use is_XID_start = unicode::derived_property::XID_Start;
52+
pub use is_XID_continue = unicode::derived_property::XID_Continue;
5353

5454

5555
/**

branches/snap-stage3/src/libcore/f32.rs

Lines changed: 40 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
77
// PORT
88

9-
use cmath::c_float::*;
10-
use cmath::c_float_targ_consts::*;
9+
pub use cmath::c_float::*;
10+
pub use cmath::c_float_targ_consts::*;
1111

1212
export add, sub, mul, div, rem, lt, le, eq, ne, ge, gt;
1313
export is_positive, is_negative, is_nonpositive, is_nonnegative;
@@ -22,58 +22,56 @@ export lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix;
2222
export modf, pow, round, sin, sinh, sqrt, tan, tanh, tgamma, trunc;
2323
export signbit;
2424

25-
export num;
26-
2725
// These are not defined inside consts:: for consistency with
2826
// the integer types
2927

30-
const NaN: f32 = 0.0_f32/0.0_f32;
28+
pub const NaN: f32 = 0.0_f32/0.0_f32;
3129

32-
const infinity: f32 = 1.0_f32/0.0_f32;
30+
pub const infinity: f32 = 1.0_f32/0.0_f32;
3331

34-
const neg_infinity: f32 = -1.0_f32/0.0_f32;
32+
pub const neg_infinity: f32 = -1.0_f32/0.0_f32;
3533

36-
pure fn is_NaN(f: f32) -> bool { f != f }
34+
pub pure fn is_NaN(f: f32) -> bool { f != f }
3735

38-
pure fn add(x: f32, y: f32) -> f32 { return x + y; }
36+
pub pure fn add(x: f32, y: f32) -> f32 { return x + y; }
3937

40-
pure fn sub(x: f32, y: f32) -> f32 { return x - y; }
38+
pub pure fn sub(x: f32, y: f32) -> f32 { return x - y; }
4139

42-
pure fn mul(x: f32, y: f32) -> f32 { return x * y; }
40+
pub pure fn mul(x: f32, y: f32) -> f32 { return x * y; }
4341

44-
pure fn div(x: f32, y: f32) -> f32 { return x / y; }
42+
pub pure fn div(x: f32, y: f32) -> f32 { return x / y; }
4543

46-
pure fn rem(x: f32, y: f32) -> f32 { return x % y; }
44+
pub pure fn rem(x: f32, y: f32) -> f32 { return x % y; }
4745

48-
pure fn lt(x: f32, y: f32) -> bool { return x < y; }
46+
pub pure fn lt(x: f32, y: f32) -> bool { return x < y; }
4947

50-
pure fn le(x: f32, y: f32) -> bool { return x <= y; }
48+
pub pure fn le(x: f32, y: f32) -> bool { return x <= y; }
5149

52-
pure fn eq(x: f32, y: f32) -> bool { return x == y; }
50+
pub pure fn eq(x: f32, y: f32) -> bool { return x == y; }
5351

54-
pure fn ne(x: f32, y: f32) -> bool { return x != y; }
52+
pub pure fn ne(x: f32, y: f32) -> bool { return x != y; }
5553

56-
pure fn ge(x: f32, y: f32) -> bool { return x >= y; }
54+
pub pure fn ge(x: f32, y: f32) -> bool { return x >= y; }
5755

58-
pure fn gt(x: f32, y: f32) -> bool { return x > y; }
56+
pub pure fn gt(x: f32, y: f32) -> bool { return x > y; }
5957

6058
// FIXME (#1999): replace the predicates below with llvm intrinsics or
6159
// calls to the libmath macros in the rust runtime for performance.
6260

6361
/// Returns true if `x` is a positive number, including +0.0f320 and +Infinity
64-
pure fn is_positive(x: f32) -> bool
62+
pub pure fn is_positive(x: f32) -> bool
6563
{ return x > 0.0f32 || (1.0f32/x) == infinity; }
6664

6765
/// Returns true if `x` is a negative number, including -0.0f320 and -Infinity
68-
pure fn is_negative(x: f32) -> bool
66+
pub pure fn is_negative(x: f32) -> bool
6967
{ return x < 0.0f32 || (1.0f32/x) == neg_infinity; }
7068

7169
/**
7270
* Returns true if `x` is a negative number, including -0.0f320 and -Infinity
7371
*
7472
* This is the same as `f32::is_negative`.
7573
*/
76-
pure fn is_nonpositive(x: f32) -> bool {
74+
pub pure fn is_nonpositive(x: f32) -> bool {
7775
return x < 0.0f32 || (1.0f32/x) == neg_infinity;
7876
}
7977

@@ -82,78 +80,76 @@ pure fn is_nonpositive(x: f32) -> bool {
8280
*
8381
* This is the same as `f32::is_positive`.)
8482
*/
85-
pure fn is_nonnegative(x: f32) -> bool {
83+
pub pure fn is_nonnegative(x: f32) -> bool {
8684
return x > 0.0f32 || (1.0f32/x) == infinity;
8785
}
8886

8987
/// Returns true if `x` is a zero number (positive or negative zero)
90-
pure fn is_zero(x: f32) -> bool {
88+
pub pure fn is_zero(x: f32) -> bool {
9189
return x == 0.0f32 || x == -0.0f32;
9290
}
9391

9492
/// Returns true if `x`is an infinite number
95-
pure fn is_infinite(x: f32) -> bool {
93+
pub pure fn is_infinite(x: f32) -> bool {
9694
return x == infinity || x == neg_infinity;
9795
}
9896

9997
/// Returns true if `x`is a finite number
100-
pure fn is_finite(x: f32) -> bool {
98+
pub pure fn is_finite(x: f32) -> bool {
10199
return !(is_NaN(x) || is_infinite(x));
102100
}
103101

104102
// FIXME (#1999): add is_normal, is_subnormal, and fpclassify.
105103

106104
/* Module: consts */
107-
mod consts {
108-
#[legacy_exports];
109-
105+
pub mod consts {
110106
// FIXME (requires Issue #1433 to fix): replace with mathematical
111107
// constants from cmath.
112108
/// Archimedes' constant
113-
const pi: f32 = 3.14159265358979323846264338327950288_f32;
109+
pub const pi: f32 = 3.14159265358979323846264338327950288_f32;
114110

115111
/// pi/2.0
116-
const frac_pi_2: f32 = 1.57079632679489661923132169163975144_f32;
112+
pub const frac_pi_2: f32 = 1.57079632679489661923132169163975144_f32;
117113

118114
/// pi/4.0
119-
const frac_pi_4: f32 = 0.785398163397448309615660845819875721_f32;
115+
pub const frac_pi_4: f32 = 0.785398163397448309615660845819875721_f32;
120116

121117
/// 1.0/pi
122-
const frac_1_pi: f32 = 0.318309886183790671537767526745028724_f32;
118+
pub const frac_1_pi: f32 = 0.318309886183790671537767526745028724_f32;
123119

124120
/// 2.0/pi
125-
const frac_2_pi: f32 = 0.636619772367581343075535053490057448_f32;
121+
pub const frac_2_pi: f32 = 0.636619772367581343075535053490057448_f32;
126122

127123
/// 2.0/sqrt(pi)
128-
const frac_2_sqrtpi: f32 = 1.12837916709551257389615890312154517_f32;
124+
pub const frac_2_sqrtpi: f32 = 1.12837916709551257389615890312154517_f32;
129125

130126
/// sqrt(2.0)
131-
const sqrt2: f32 = 1.41421356237309504880168872420969808_f32;
127+
pub const sqrt2: f32 = 1.41421356237309504880168872420969808_f32;
132128

133129
/// 1.0/sqrt(2.0)
134-
const frac_1_sqrt2: f32 = 0.707106781186547524400844362104849039_f32;
130+
pub const frac_1_sqrt2: f32 = 0.707106781186547524400844362104849039_f32;
135131

136132
/// Euler's number
137-
const e: f32 = 2.71828182845904523536028747135266250_f32;
133+
pub const e: f32 = 2.71828182845904523536028747135266250_f32;
138134

139135
/// log2(e)
140-
const log2_e: f32 = 1.44269504088896340735992468100189214_f32;
136+
pub const log2_e: f32 = 1.44269504088896340735992468100189214_f32;
141137

142138
/// log10(e)
143-
const log10_e: f32 = 0.434294481903251827651128918916605082_f32;
139+
pub const log10_e: f32 = 0.434294481903251827651128918916605082_f32;
144140

145141
/// ln(2.0)
146-
const ln_2: f32 = 0.693147180559945309417232121458176568_f32;
142+
pub const ln_2: f32 = 0.693147180559945309417232121458176568_f32;
147143

148144
/// ln(10.0)
149-
const ln_10: f32 = 2.30258509299404568401799145468436421_f32;
145+
pub const ln_10: f32 = 2.30258509299404568401799145468436421_f32;
150146
}
151147

152-
pure fn signbit(x: f32) -> int {
148+
pub pure fn signbit(x: f32) -> int {
153149
if is_negative(x) { return 1; } else { return 0; }
154150
}
155151

156-
pure fn logarithm(n: f32, b: f32) -> f32 {
152+
pub pure fn logarithm(n: f32, b: f32) -> f32 {
157153
return log2(n) / log2(b);
158154
}
159155

0 commit comments

Comments
 (0)