From 9655379852fdbf3a0797035fc30a4060a2b191cf Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 4 Mar 2012 23:01:33 +0100 Subject: remainder, remainderf, remainderl: Fix computation for large quotients. * lib/remainder.c: Completely rewritten. * lib/remainderf.c (remainderf): Use implementation of remainder.c with USE_FLOAT. * lib/remainderl.c (remainderl): Use implementation of remainder.c with USE_LONG_DOUBLE. * modules/remainder (Depends-on): Add isfinite, signbit, fabs, fmod, isnand, isinf. Remove round, fma. * modules/remainderf (Files): Add lib/remainder.c. (Depends-on): Add isfinite, signbit, fabsf, fmodf, isnanf, isinf. Remove roundf, fmaf. * modules/remainderl (Files): Add lib/remainder.c. (Depends-on): Add float, isfinite, signbit, fabsl, fmodl, isnanl, isinf. Remove roundl, fmal. * m4/remainder.m4 (gl_FUNC_REMAINDER): Update computation of REMAINDER_LIBM. * m4/remainderf.m4 (gl_FUNC_REMAINDERF): Update computation of REMAINDERF_LIBM. * m4/remainderl.m4 (gl_FUNC_REMAINDERL): Update computation of REMAINDERL_LIBM. --- m4/remainder.m4 | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'm4/remainder.m4') diff --git a/m4/remainder.m4 b/m4/remainder.m4 index 855c1bb3f2..f788a20fc7 100644 --- a/m4/remainder.m4 +++ b/m4/remainder.m4 @@ -1,4 +1,4 @@ -# remainder.m4 serial 2 +# remainder.m4 serial 3 dnl Copyright (C) 2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -104,18 +104,24 @@ int main (int argc, char *argv[]) fi if test $HAVE_REMAINDER = 0 || test $REPLACE_REMAINDER = 1; then dnl Find libraries needed to link lib/remainder.c. - AC_REQUIRE([gl_FUNC_ROUND]) - AC_REQUIRE([gl_FUNC_FMA]) + AC_REQUIRE([gl_FUNC_FABS]) + AC_REQUIRE([gl_FUNC_FMOD]) + AC_REQUIRE([gl_FUNC_ISNAND]) REMAINDER_LIBM= - dnl Append $ROUND_LIBM to REMAINDER_LIBM, avoiding gratuitous duplicates. + dnl Append $FABS_LIBM to REMAINDER_LIBM, avoiding gratuitous duplicates. case " $REMAINDER_LIBM " in - *" $ROUND_LIBM "*) ;; - *) REMAINDER_LIBM="$REMAINDER_LIBM $ROUND_LIBM" ;; + *" $FABS_LIBM "*) ;; + *) REMAINDER_LIBM="$REMAINDER_LIBM $FABS_LIBM" ;; esac - dnl Append $FMA_LIBM to REMAINDER_LIBM, avoiding gratuitous duplicates. + dnl Append $FMOD_LIBM to REMAINDER_LIBM, avoiding gratuitous duplicates. case " $REMAINDER_LIBM " in - *" $FMA_LIBM "*) ;; - *) REMAINDER_LIBM="$REMAINDER_LIBM $FMA_LIBM" ;; + *" $FMOD_LIBM "*) ;; + *) REMAINDER_LIBM="$REMAINDER_LIBM $FMOD_LIBM" ;; + esac + dnl Append $ISNAND_LIBM to REMAINDER_LIBM, avoiding gratuitous duplicates. + case " $REMAINDER_LIBM " in + *" $ISNAND_LIBM "*) ;; + *) REMAINDER_LIBM="$REMAINDER_LIBM $ISNAND_LIBM" ;; esac fi AC_SUBST([REMAINDER_LIBM]) -- cgit v1.2.1