Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 03b46a9

Browse files
committed
Correct libm names
1 parent a762159 commit 03b46a9

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
88
### Added
99

1010
- minf
11-
- min
12-
- maxf
13-
- max
11+
- fmin
12+
- fmaxf
13+
- fmax
1414

1515
## [v0.1.2] - 2018-07-18
1616

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,12 @@ impl F32Ext for f32 {
334334

335335
#[inline]
336336
fn min(self, other: Self) -> Self {
337-
minf(self, other)
337+
fminf(self, other)
338338
}
339339

340340
#[inline]
341341
fn max(self, other: Self) -> Self {
342-
maxf(self, other)
342+
fmaxf(self, other)
343343
}
344344
}
345345

@@ -622,12 +622,12 @@ impl F64Ext for f64 {
622622

623623
#[inline]
624624
fn min(self, other: Self) -> Self {
625-
min(self, other)
625+
fmin(self, other)
626626
}
627627

628628
#[inline]
629629
fn max(self, other: Self) -> Self {
630-
max(self, other)
630+
fmax(self, other)
631631
}
632632
}
633633

src/math/max.rs renamed to src/math/fmax.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[inline]
22
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
3-
pub fn max(x: f64, y: f64) -> f64 {
3+
pub fn fmax(x: f64, y: f64) -> f64 {
44
// IEEE754 says: maxNum(x, y) is the canonicalized number y if x < y, x if y < x, the
55
// canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
66
// is either x or y, canonicalized (this means results might differ among implementations).

src/math/maxf.rs renamed to src/math/fmaxf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[inline]
22
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
3-
pub fn maxf(x: f32, y: f32) -> f32 {
3+
pub fn fmaxf(x: f32, y: f32) -> f32 {
44
// IEEE754 says: maxNum(x, y) is the canonicalized number y if x < y, x if y < x, the
55
// canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
66
// is either x or y, canonicalized (this means results might differ among implementations).

src/math/min.rs renamed to src/math/fmin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[inline]
22
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
3-
pub fn min(x: f64, y: f64) -> f64 {
3+
pub fn fmin(x: f64, y: f64) -> f64 {
44
// IEEE754 says: minNum(x, y) is the canonicalized number x if x < y, y if y < x, the
55
// canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
66
// is either x or y, canonicalized (this means results might differ among implementations).

src/math/minf.rs renamed to src/math/fminf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[inline]
22
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
3-
pub fn minf(x: f32, y: f32) -> f32 {
3+
pub fn fminf(x: f32, y: f32) -> f32 {
44
// IEEE754 says: minNum(x, y) is the canonicalized number x if x < y, y if y < x, the
55
// canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
66
// is either x or y, canonicalized (this means results might differ among implementations).

src/math/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ mod floor;
112112
mod floorf;
113113
mod fma;
114114
mod fmaf;
115+
mod fmax;
116+
mod fmaxf;
117+
mod fmin;
118+
mod fminf;
115119
mod fmod;
116120
mod fmodf;
117121
mod frexp;
@@ -140,10 +144,6 @@ mod log1pf;
140144
mod log2;
141145
mod log2f;
142146
mod logf;
143-
mod max;
144-
mod maxf;
145-
mod min;
146-
mod minf;
147147
mod modf;
148148
mod modff;
149149
mod pow;
@@ -216,6 +216,10 @@ pub use self::floor::floor;
216216
pub use self::floorf::floorf;
217217
pub use self::fma::fma;
218218
pub use self::fmaf::fmaf;
219+
pub use self::fmax::fmax;
220+
pub use self::fmaxf::fmaxf;
221+
pub use self::fmin::fmin;
222+
pub use self::fminf::fminf;
219223
pub use self::fmod::fmod;
220224
pub use self::fmodf::fmodf;
221225
pub use self::frexp::frexp;
@@ -250,10 +254,6 @@ pub use self::log1pf::log1pf;
250254
pub use self::log2::log2;
251255
pub use self::log2f::log2f;
252256
pub use self::logf::logf;
253-
pub use self::max::max;
254-
pub use self::maxf::maxf;
255-
pub use self::min::min;
256-
pub use self::minf::minf;
257257
pub use self::modf::modf;
258258
pub use self::modff::modff;
259259
pub use self::pow::pow;

0 commit comments

Comments
 (0)