Hash :
9c7ca2ba
Author :
Date :
2023-08-20T13:23:11
ldexp: fix INT_MIN infloop * lib/ldexp.c (FUNC): Instead of converting EXP to unsigned, work on it directly. This simplifies the code and avoids an infinite loop when EXP == INT_MIN. * modules/ldexp, modules/ldexpl: Depend on stdbool. * tests/test-ldexp.h: Include <limits.h> for INT_MIN. (test_function): Test for infloop.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Description:
ldexpl() function: multiply a 'long double' by a power of 2.
Files:
lib/ldexpl.c
lib/ldexp.c
m4/ldexpl.m4
Depends-on:
math
extensions
ldexp [{ test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1]
isnanl [{ test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
fpucw [{ test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
stdbool [{ test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
configure.ac:
gl_FUNC_LDEXPL
gl_CONDITIONAL([GL_COND_OBJ_LDEXPL],
[test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no])
gl_MATH_MODULE_INDICATOR([ldexpl])
Makefile.am:
if GL_COND_OBJ_LDEXPL
lib_SOURCES += ldexpl.c
endif
Include:
<math.h>
Link:
$(LDEXPL_LIBM)
License:
LGPLv2+
Maintainer:
Paolo Bonzini