Skip to content

Commit

Permalink
Merge pull request #196 from Schultzer/add-remainder
Browse files Browse the repository at this point in the history
Add remainder
  • Loading branch information
alexcrichton committed Jul 4, 2019
2 parents c83f16a + da9c12b commit f43bc0d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/math/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ mod modf;
mod modff;
mod pow;
mod powf;
mod remainder;
mod remainderf;
mod remquo;
mod remquof;
mod round;
Expand Down Expand Up @@ -258,6 +260,8 @@ pub use self::modf::modf;
pub use self::modff::modff;
pub use self::pow::pow;
pub use self::powf::powf;
pub use self::remainder::remainder;
pub use self::remainderf::remainderf;
pub use self::remquo::remquo;
pub use self::remquof::remquof;
pub use self::round::round;
Expand Down
6 changes: 6 additions & 0 deletions src/math/remainder.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn remainder(x: f64, y: f64) -> f64 {
let (result, _) = super::remquo(x, y);
result
}
6 changes: 6 additions & 0 deletions src/math/remainderf.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn remainderf(x: f32, y: f32) -> f32 {
let (result, _) = super::remquof(x, y);
result
}

0 comments on commit f43bc0d

Please sign in to comment.