Skip to content

Commit 32df8ed

Browse files
committed
Rename nextafter to next_after to match method name in Float
1 parent 4cc9d0b commit 32df8ed

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/libcore/num/cmath.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ pub mod c_double_utils {
4747
unsafe fn fmax(a: c_double, b: c_double) -> c_double;
4848
#[link_name="fmin"]
4949
unsafe fn fmin(a: c_double, b: c_double) -> c_double;
50-
unsafe fn nextafter(x: c_double, y: c_double) -> c_double;
50+
#[link_name="nextafter"]
51+
unsafe fn next_after(x: c_double, y: c_double) -> c_double;
5152
unsafe fn frexp(n: c_double, value: &mut c_int) -> c_double;
5253
unsafe fn hypot(x: c_double, y: c_double) -> c_double;
5354
unsafe fn ldexp(x: c_double, n: c_int) -> c_double;
@@ -131,7 +132,7 @@ pub mod c_float_utils {
131132
#[link_name="fminf"]
132133
unsafe fn fmin(a: c_float, b: c_float) -> c_float;
133134
#[link_name="nextafterf"]
134-
unsafe fn nextafter(x: c_float, y: c_float) -> c_float;
135+
unsafe fn next_after(x: c_float, y: c_float) -> c_float;
135136
#[link_name="hypotf"]
136137
unsafe fn hypot(x: c_float, y: c_float) -> c_float;
137138
#[link_name="ldexpf"]

src/libcore/num/f32.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ delegate!(
8888
fn abs_sub(a: c_float, b: c_float) -> c_float = c_float_utils::abs_sub,
8989
fn fmax(a: c_float, b: c_float) -> c_float = c_float_utils::fmax,
9090
fn fmin(a: c_float, b: c_float) -> c_float = c_float_utils::fmin,
91-
fn nextafter(x: c_float, y: c_float) -> c_float = c_float_utils::nextafter,
91+
fn next_after(x: c_float, y: c_float) -> c_float = c_float_utils::next_after,
9292
fn frexp(n: c_float, value: &mut c_int) -> c_float = c_float_utils::frexp,
9393
fn hypot(x: c_float, y: c_float) -> c_float = c_float_utils::hypot,
9494
fn ldexp(x: c_float, n: c_int) -> c_float = c_float_utils::ldexp,
@@ -586,7 +586,7 @@ impl Float for f32 {
586586
/// Returns the next representable floating-point value in the direction of `other`
587587
#[inline(always)]
588588
fn next_after(&self, other: f32) -> f32 {
589-
nextafter(*self, other)
589+
next_after(*self, other)
590590
}
591591
}
592592

src/libcore/num/f64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ delegate!(
8989
fn abs_sub(a: c_double, b: c_double) -> c_double = c_double_utils::abs_sub,
9090
fn fmax(a: c_double, b: c_double) -> c_double = c_double_utils::fmax,
9191
fn fmin(a: c_double, b: c_double) -> c_double = c_double_utils::fmin,
92-
fn nextafter(x: c_double, y: c_double) -> c_double = c_double_utils::nextafter,
92+
fn next_after(x: c_double, y: c_double) -> c_double = c_double_utils::next_after,
9393
fn frexp(n: c_double, value: &mut c_int) -> c_double = c_double_utils::frexp,
9494
fn hypot(x: c_double, y: c_double) -> c_double = c_double_utils::hypot,
9595
fn ldexp(x: c_double, n: c_int) -> c_double = c_double_utils::ldexp,
@@ -626,7 +626,7 @@ impl Float for f64 {
626626
/// Returns the next representable floating-point value in the direction of `other`
627627
#[inline(always)]
628628
fn next_after(&self, other: f64) -> f64 {
629-
nextafter(*self, other)
629+
next_after(*self, other)
630630
}
631631
}
632632

src/libcore/num/float.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub use f64::{add, sub, mul, quot, rem, lt, le, eq, ne, ge, gt};
2929
pub use f64::logarithm;
3030
pub use f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor};
3131
pub use f64::{erf, erfc, exp, expm1, exp2, abs_sub};
32-
pub use f64::{mul_add, fmax, fmin, nextafter, frexp, hypot, ldexp};
32+
pub use f64::{mul_add, fmax, fmin, next_after, frexp, hypot, ldexp};
3333
pub use f64::{lgamma, ln, log_radix, ln1p, log10, log2, ilog_radix};
3434
pub use f64::{modf, pow, powi, round, sinh, tanh, tgamma, trunc};
3535
pub use f64::{j0, j1, jn, y0, y1, yn};
@@ -778,7 +778,7 @@ impl Float for float {
778778
/// Returns the next representable floating-point value in the direction of `other`
779779
#[inline(always)]
780780
fn next_after(&self, other: float) -> float {
781-
nextafter(*self as f64, other as f64) as float
781+
next_after(*self as f64, other as f64) as float
782782
}
783783
}
784784

0 commit comments

Comments
 (0)