aboutsummaryrefslogtreecommitdiff
path: root/src/math/lgammaf_r.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/lgammaf_r.rs')
-rw-r--r--src/math/lgammaf_r.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/math/lgammaf_r.rs b/src/math/lgammaf_r.rs
index c5e559f..723c90d 100644
--- a/src/math/lgammaf_r.rs
+++ b/src/math/lgammaf_r.rs
@@ -88,7 +88,7 @@ fn sin_pi(mut x: f32) -> f32 {
x = 2.0 * (x * 0.5 - floorf(x * 0.5)); /* x mod 2.0 */
n = (x * 4.0) as isize;
- n = (n + 1) / 2;
+ n = div!(n + 1, 2);
y = (x as f64) - (n as f64) * 0.5;
y *= 3.14159265358979323846;
match n {
@@ -99,6 +99,7 @@ fn sin_pi(mut x: f32) -> f32 {
}
}
+#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn lgammaf_r(mut x: f32) -> (f32, i32) {
let u = x.to_bits();
let mut t: f32;