[PATCH 19/59] math: use fabs on __ieee754_lgamma_r

Adhemerval Zanella adhemerval.zanella@linaro.org
Fri Oct 17 19:12:54 GMT 2025


clang issues:

  ../sysdeps/ieee754/dbl-64/e_lgamma_r.c:234:29: error: absolute value function 'fabsf'
  given an argument of type 'double' but has parameter of type 'float' which may cause \
  truncation of value [-Werror,-Wabsolute-value]

It should not matter because the value is 0.0, but using fabs is
simpler than adding a warning suppresion.
---
 sysdeps/ieee754/dbl-64/e_lgamma_r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sysdeps/ieee754/dbl-64/e_lgamma_r.c b/sysdeps/ieee754/dbl-64/e_lgamma_r.c
index c298c8ca03..0b0c4e6f4c 100644
--- a/sysdeps/ieee754/dbl-64/e_lgamma_r.c
+++ b/sysdeps/ieee754/dbl-64/e_lgamma_r.c
@@ -231,7 +231,7 @@ __ieee754_lgamma_r(double x, int *signgamp)
 	    if (x < -2.0 && x > -28.0)
 		return __lgamma_neg (x, signgamp);
 	    t = sin_pi(x);
-	    if(t==zero) return one/fabsf(t); /* -integer */
+	    if(t==zero) return one/fabs(t); /* -integer */
 	    nadj = __ieee754_log(pi/fabs(t*x));
 	    if(t<zero) *signgamp = -1;
 	    x = -x;
-- 
2.43.0



More information about the Libc-alpha mailing list