summaryrefslogtreecommitdiffstats
path: root/vendor/libm/src/math/lgammaf_r.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/libm/src/math/lgammaf_r.rs')
-rw-r--r--vendor/libm/src/math/lgammaf_r.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/vendor/libm/src/math/lgammaf_r.rs b/vendor/libm/src/math/lgammaf_r.rs
index 0745359a2..723c90daf 100644
--- a/vendor/libm/src/math/lgammaf_r.rs
+++ b/vendor/libm/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;
@@ -205,9 +206,9 @@ pub fn lgammaf_r(mut x: f32) -> (f32, i32) {
p2 = 1.0 + y * (V1 + y * (V2 + y * (V3 + y * (V4 + y * V5))));
r += -0.5 * y + p1 / p2;
}
- #[cfg(feature = "checked")]
+ #[cfg(debug_assertions)]
_ => unreachable!(),
- #[cfg(not(feature = "checked"))]
+ #[cfg(not(debug_assertions))]
_ => {}
}
} else if ix < 0x41000000 {