diff --git a/src/libcore/num/cmath.rs b/src/libcore/num/cmath.rs index 378ebfa53a0..30b0c54dc2d 100644 --- a/src/libcore/num/cmath.rs +++ b/src/libcore/num/cmath.rs @@ -47,7 +47,8 @@ pub mod c_double_utils { unsafe fn fmax(a: c_double, b: c_double) -> c_double; #[link_name="fmin"] unsafe fn fmin(a: c_double, b: c_double) -> c_double; - unsafe fn nextafter(x: c_double, y: c_double) -> c_double; + #[link_name="nextafter"] + unsafe fn next_after(x: c_double, y: c_double) -> c_double; unsafe fn frexp(n: c_double, value: &mut c_int) -> c_double; unsafe fn hypot(x: c_double, y: c_double) -> c_double; unsafe fn ldexp(x: c_double, n: c_int) -> c_double; @@ -131,7 +132,7 @@ pub mod c_float_utils { #[link_name="fminf"] unsafe fn fmin(a: c_float, b: c_float) -> c_float; #[link_name="nextafterf"] - unsafe fn nextafter(x: c_float, y: c_float) -> c_float; + unsafe fn next_after(x: c_float, y: c_float) -> c_float; #[link_name="hypotf"] unsafe fn hypot(x: c_float, y: c_float) -> c_float; #[link_name="ldexpf"] diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs index bc067369bdb..97ad23696bd 100644 --- a/src/libcore/num/f32.rs +++ b/src/libcore/num/f32.rs @@ -88,7 +88,7 @@ delegate!( fn abs_sub(a: c_float, b: c_float) -> c_float = c_float_utils::abs_sub, fn fmax(a: c_float, b: c_float) -> c_float = c_float_utils::fmax, fn fmin(a: c_float, b: c_float) -> c_float = c_float_utils::fmin, - fn nextafter(x: c_float, y: c_float) -> c_float = c_float_utils::nextafter, + fn next_after(x: c_float, y: c_float) -> c_float = c_float_utils::next_after, fn frexp(n: c_float, value: &mut c_int) -> c_float = c_float_utils::frexp, fn hypot(x: c_float, y: c_float) -> c_float = c_float_utils::hypot, fn ldexp(x: c_float, n: c_int) -> c_float = c_float_utils::ldexp, @@ -586,7 +586,7 @@ impl Float for f32 { /// Returns the next representable floating-point value in the direction of `other` #[inline(always)] fn next_after(&self, other: f32) -> f32 { - nextafter(*self, other) + next_after(*self, other) } } diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs index 2a9f1cb3350..92ce4969f47 100644 --- a/src/libcore/num/f64.rs +++ b/src/libcore/num/f64.rs @@ -89,7 +89,7 @@ delegate!( fn abs_sub(a: c_double, b: c_double) -> c_double = c_double_utils::abs_sub, fn fmax(a: c_double, b: c_double) -> c_double = c_double_utils::fmax, fn fmin(a: c_double, b: c_double) -> c_double = c_double_utils::fmin, - fn nextafter(x: c_double, y: c_double) -> c_double = c_double_utils::nextafter, + fn next_after(x: c_double, y: c_double) -> c_double = c_double_utils::next_after, fn frexp(n: c_double, value: &mut c_int) -> c_double = c_double_utils::frexp, fn hypot(x: c_double, y: c_double) -> c_double = c_double_utils::hypot, fn ldexp(x: c_double, n: c_int) -> c_double = c_double_utils::ldexp, @@ -626,7 +626,7 @@ impl Float for f64 { /// Returns the next representable floating-point value in the direction of `other` #[inline(always)] fn next_after(&self, other: f64) -> f64 { - nextafter(*self, other) + next_after(*self, other) } } diff --git a/src/libcore/num/float.rs b/src/libcore/num/float.rs index 55f12817026..d784aeb2397 100644 --- a/src/libcore/num/float.rs +++ b/src/libcore/num/float.rs @@ -29,7 +29,7 @@ pub use f64::{add, sub, mul, quot, rem, lt, le, eq, ne, ge, gt}; pub use f64::logarithm; pub use f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor}; pub use f64::{erf, erfc, exp, expm1, exp2, abs_sub}; -pub use f64::{mul_add, fmax, fmin, nextafter, frexp, hypot, ldexp}; +pub use f64::{mul_add, fmax, fmin, next_after, frexp, hypot, ldexp}; pub use f64::{lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix}; pub use f64::{modf, pow, powi, round, sinh, tanh, tgamma, trunc}; pub use f64::{j0, j1, jn, y0, y1, yn}; @@ -778,7 +778,7 @@ impl Float for float { /// Returns the next representable floating-point value in the direction of `other` #[inline(always)] fn next_after(&self, other: float) -> float { - nextafter(*self as f64, other as f64) as float + next_after(*self as f64, other as f64) as float } }