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

Commit f43bc0d

Browse files
authored
Merge pull request #196 from Schultzer/add-remainder
Add remainder
2 parents c83f16a + da9c12b commit f43bc0d

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#[inline]
2+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
3+
pub fn remainder(x: f64, y: f64) -> f64 {
4+
let (result, _) = super::remquo(x, y);
5+
result
6+
}

src/math/remainderf.rs

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

0 commit comments

Comments
 (0)