Skip to content

Commit 0ae4428

Browse files
authored
Merge pull request rust-lang#161 from alexcrichton/ldexp
Add bindings for ldexp/ldexpf
2 parents b93ba68 + 7e49f83 commit 0ae4428

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/math/ldexp.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 ldexp(x: f64, n: i32) -> f64 {
4+
super::scalbn(x, n)
5+
}

src/math/ldexpf.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 ldexpf(x: f32, n: i32) -> f32 {
4+
super::scalbnf(x, n)
5+
}

src/math/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ mod fmod;
104104
mod fmodf;
105105
mod hypot;
106106
mod hypotf;
107+
mod ldexp;
108+
mod ldexpf;
107109
mod log;
108110
mod log10;
109111
mod log10f;
@@ -166,6 +168,8 @@ pub use self::fmod::fmod;
166168
pub use self::fmodf::fmodf;
167169
pub use self::hypot::hypot;
168170
pub use self::hypotf::hypotf;
171+
pub use self::ldexp::ldexp;
172+
pub use self::ldexpf::ldexpf;
169173
pub use self::log::log;
170174
pub use self::log10::log10;
171175
pub use self::log10f::log10f;

0 commit comments

Comments
 (0)