Skip to content

Commit a88c084

Browse files
committed
core: Reexport all the imports in f32/64
1 parent fb1eb1c commit a88c084

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

src/libcore/f32.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ Floating point operations and constants for `f32`
99
import cmath::c_float::*;
1010
import cmath::c_float_targ_consts::*;
1111

12+
// FIXME find out why these have to be exported explicitly
13+
14+
export add, sub, mul, div, rem, lt, le, gt, eq, eq, ne;
15+
export is_positive, is_negative, is_nonpositive, is_nonnegative;
16+
export is_zero, is_infinite, is_finite;
17+
export NaN, is_NaN, infinity, neg_infinity;
18+
export consts;
19+
export logarithm;
20+
export acos, asin, atan, atan2, cbrt, ceil, copysign, cos, cosh;
21+
export erf, erfc, exp, expm1, exp2, abs, abs_sub;
22+
export mul_add, fmax, fmin, nextafter, frexp, hypot, ldexp;
23+
export lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix;
24+
export modf, pow, round, sin, sinh, sqrt, tan, tanh, tgamma, trunc;
25+
export signbit;
26+
1227
type t = f32;
1328

1429
// These are not defined inside consts:: for consistency with

src/libcore/f64.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ Floating point operations and constants for `f64`
99
import cmath::c_double::*;
1010
import cmath::c_double_targ_consts::*;
1111

12+
// FIXME find out why these have to be exported explicitly
13+
14+
export add, sub, mul, div, rem, lt, le, gt, eq, eq, ne;
15+
export is_positive, is_negative, is_nonpositive, is_nonnegative;
16+
export is_zero, is_infinite, is_finite;
17+
export NaN, is_NaN, infinity, neg_infinity;
18+
export consts;
19+
export logarithm;
20+
export acos, asin, atan, atan2, cbrt, ceil, copysign, cos, cosh;
21+
export erf, erfc, exp, expm1, exp2, abs, abs_sub;
22+
export mul_add, fmax, fmin, nextafter, frexp, hypot, ldexp;
23+
export lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix;
24+
export modf, pow, round, sin, sinh, sqrt, tan, tanh, tgamma, trunc;
25+
export signbit;
26+
export epsilon;
27+
1228
type t = f64;
1329

1430
// These are not defined inside consts:: for consistency with
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Regression test that f64 exports things properly
2+
3+
use std;
4+
import std::io::println;
5+
6+
fn main() {
7+
8+
let digits: uint = 10 as uint;
9+
10+
println( float::to_str( f64::sqrt(42.0), digits) );
11+
}

0 commit comments

Comments
 (0)