Skip to content

Commit

Permalink
Merge pull request #161 from alexcrichton/ldexp
Browse files Browse the repository at this point in the history
Add bindings for ldexp/ldexpf
  • Loading branch information
alexcrichton committed May 2, 2019
2 parents b93ba68 + 7e49f83 commit 0ae4428
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/math/ldexp.rs
@@ -0,0 +1,5 @@
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn ldexp(x: f64, n: i32) -> f64 {
super::scalbn(x, n)
}
5 changes: 5 additions & 0 deletions src/math/ldexpf.rs
@@ -0,0 +1,5 @@
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn ldexpf(x: f32, n: i32) -> f32 {
super::scalbnf(x, n)
}
4 changes: 4 additions & 0 deletions src/math/mod.rs
Expand Up @@ -104,6 +104,8 @@ mod fmod;
mod fmodf;
mod hypot;
mod hypotf;
mod ldexp;
mod ldexpf;
mod log;
mod log10;
mod log10f;
Expand Down Expand Up @@ -166,6 +168,8 @@ pub use self::fmod::fmod;
pub use self::fmodf::fmodf;
pub use self::hypot::hypot;
pub use self::hypotf::hypotf;
pub use self::ldexp::ldexp;
pub use self::ldexpf::ldexpf;
pub use self::log::log;
pub use self::log10::log10;
pub use self::log10f::log10f;
Expand Down

0 comments on commit 0ae4428

Please sign in to comment.