Rename nextafter to next_after to match method name in Float

This commit is contained in:
Brendan Zabarauskas 2013-04-27 10:16:09 +10:00
parent 4cc9d0ba7e
commit 32df8ed877
4 changed files with 9 additions and 8 deletions

View File

@ -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"]

View File

@ -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)
}
}

View File

@ -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)
}
}

View File

@ -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
}
}