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

Commit a0dd055

Browse files
committed
Add remainder
This PR adds the missing `remainder` and `remainderf` found in musl libm respectly https://git.musl-libc.org/cgit/musl/tree/src/math/remainder.c and https://git.musl-libc.org/cgit/musl/tree/src/math/remainderf.c Signed-off-by: Benjamin Schultzer <[email protected]>
1 parent b03bda3 commit a0dd055

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/math/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ mod modf;
148148
mod modff;
149149
mod pow;
150150
mod powf;
151+
mod remainder;
152+
mod remainderf;
151153
mod remquo;
152154
mod remquof;
153155
mod round;
@@ -258,6 +260,8 @@ pub use self::modf::modf;
258260
pub use self::modff::modff;
259261
pub use self::pow::pow;
260262
pub use self::powf::powf;
263+
pub use self::remainder::remainder;
264+
pub use self::remainderf::remainderf;
261265
pub use self::remquo::remquo;
262266
pub use self::remquof::remquof;
263267
pub use self::round::round;

src/math/remainder.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#[inline]
2+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
3+
pub fn remainder(x: f64, y: f64) -> (f64, i32) {
4+
super::remquo(x, y)
5+
}

src/math/remainderf.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#[inline]
2+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
3+
pub fn remainderf(x: f32, y: f32) -> (f32, i32) {
4+
super::remquof(x, y)
5+
}

0 commit comments

Comments
 (0)