mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
Issue #5724: Fix cmath failures on Solaris 10.
This commit is contained in:
parent
6703225258
commit
e05e8409e1
7 changed files with 397 additions and 22 deletions
|
@ -77,6 +77,21 @@ extern double copysign(double, double);
|
||||||
#define Py_MATH_E 2.7182818284590452354
|
#define Py_MATH_E 2.7182818284590452354
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* On x86, Py_FORCE_DOUBLE forces a floating-point number out of an x87 FPU
|
||||||
|
register and into a 64-bit memory location, rounding from extended
|
||||||
|
precision to double precision in the process. On other platforms it does
|
||||||
|
nothing. */
|
||||||
|
|
||||||
|
/* we take double rounding as evidence of x87 usage */
|
||||||
|
#ifndef Py_FORCE_DOUBLE
|
||||||
|
# ifdef X87_DOUBLE_ROUNDING
|
||||||
|
PyAPI_FUNC(double) _Py_force_double(double);
|
||||||
|
# define Py_FORCE_DOUBLE(X) (_Py_force_double(X))
|
||||||
|
# else
|
||||||
|
# define Py_FORCE_DOUBLE(X) (X)
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Py_IS_NAN(X)
|
/* Py_IS_NAN(X)
|
||||||
* Return 1 if float or double arg is a NaN, else 0.
|
* Return 1 if float or double arg is a NaN, else 0.
|
||||||
* Caution:
|
* Caution:
|
||||||
|
@ -87,7 +102,7 @@ extern double copysign(double, double);
|
||||||
* Note: PC/pyconfig.h defines Py_IS_NAN as _isnan
|
* Note: PC/pyconfig.h defines Py_IS_NAN as _isnan
|
||||||
*/
|
*/
|
||||||
#ifndef Py_IS_NAN
|
#ifndef Py_IS_NAN
|
||||||
#ifdef HAVE_ISNAN
|
#if defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1
|
||||||
#define Py_IS_NAN(X) isnan(X)
|
#define Py_IS_NAN(X) isnan(X)
|
||||||
#else
|
#else
|
||||||
#define Py_IS_NAN(X) ((X) != (X))
|
#define Py_IS_NAN(X) ((X) != (X))
|
||||||
|
@ -101,14 +116,18 @@ extern double copysign(double, double);
|
||||||
* This implementation may set the underflow flag if |X| is very small;
|
* This implementation may set the underflow flag if |X| is very small;
|
||||||
* it really can't be implemented correctly (& easily) before C99.
|
* it really can't be implemented correctly (& easily) before C99.
|
||||||
* Override in pyconfig.h if you have a better spelling on your platform.
|
* Override in pyconfig.h if you have a better spelling on your platform.
|
||||||
|
* Py_FORCE_DOUBLE is used to avoid getting false negatives from a
|
||||||
|
* non-infinite value v sitting in an 80-bit x87 register such that
|
||||||
|
* v becomes infinite when spilled from the register to 64-bit memory.
|
||||||
* Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf
|
* Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf
|
||||||
*/
|
*/
|
||||||
#ifndef Py_IS_INFINITY
|
#ifndef Py_IS_INFINITY
|
||||||
#ifdef HAVE_ISINF
|
# if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1
|
||||||
#define Py_IS_INFINITY(X) isinf(X)
|
# define Py_IS_INFINITY(X) isinf(X)
|
||||||
#else
|
# else
|
||||||
#define Py_IS_INFINITY(X) ((X) && (X)*0.5 == (X))
|
# define Py_IS_INFINITY(X) ((X) && \
|
||||||
#endif
|
(Py_FORCE_DOUBLE(X)*0.5 == Py_FORCE_DOUBLE(X)))
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Py_IS_FINITE(X)
|
/* Py_IS_FINITE(X)
|
||||||
|
@ -118,7 +137,9 @@ extern double copysign(double, double);
|
||||||
* Note: PC/pyconfig.h defines Py_IS_FINITE as _finite
|
* Note: PC/pyconfig.h defines Py_IS_FINITE as _finite
|
||||||
*/
|
*/
|
||||||
#ifndef Py_IS_FINITE
|
#ifndef Py_IS_FINITE
|
||||||
#ifdef HAVE_FINITE
|
#if defined HAVE_DECL_ISFINITE && HAVE_DECL_ISFINITE == 1
|
||||||
|
#define Py_IS_FINITE(X) isfinite(X)
|
||||||
|
#elif defined HAVE_FINITE
|
||||||
#define Py_IS_FINITE(X) finite(X)
|
#define Py_IS_FINITE(X) finite(X)
|
||||||
#else
|
#else
|
||||||
#define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X))
|
#define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X))
|
||||||
|
|
|
@ -12,6 +12,10 @@ What's New in Python 2.6.3
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #5724: (See also issue #4575.) Fix Py_IS_INFINITY macro to
|
||||||
|
work correctly on x87 FPUs: it now forces its argument to double
|
||||||
|
before testing for infinity.
|
||||||
|
|
||||||
- Issue #4971: Fix titlecase for characters that are their own
|
- Issue #4971: Fix titlecase for characters that are their own
|
||||||
titlecase, but not their own uppercase.
|
titlecase, but not their own uppercase.
|
||||||
|
|
||||||
|
|
|
@ -405,11 +405,11 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
|
||||||
/* Define to 1 if you have the `copysign' function. */
|
/* Define to 1 if you have the `copysign' function. */
|
||||||
#define HAVE_COPYSIGN 1
|
#define HAVE_COPYSIGN 1
|
||||||
|
|
||||||
/* Define to 1 if you have the `isinf' function. */
|
/* Define to 1 if you have the `isinf' macro. */
|
||||||
#define HAVE_ISINF 1
|
#define HAVE_DECL_ISINF 1
|
||||||
|
|
||||||
/* Define to 1 if you have the `isnan' function. */
|
/* Define to 1 if you have the `isnan' function. */
|
||||||
#define HAVE_ISNAN 1
|
#define HAVE_DECL_ISNAN 1
|
||||||
|
|
||||||
/* Define if on AIX 3.
|
/* Define if on AIX 3.
|
||||||
System headers sometimes define this.
|
System headers sometimes define this.
|
||||||
|
|
|
@ -1,5 +1,18 @@
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
|
|
||||||
|
#ifdef X87_DOUBLE_ROUNDING
|
||||||
|
/* On x86 platforms using an x87 FPU, this function is called from the
|
||||||
|
Py_FORCE_DOUBLE macro (defined in pymath.h) to force a floating-point
|
||||||
|
number out of an 80-bit x87 FPU register and into a 64-bit memory location,
|
||||||
|
thus rounding from extended precision to double precision. */
|
||||||
|
double _Py_force_double(double x)
|
||||||
|
{
|
||||||
|
volatile double y;
|
||||||
|
y = x;
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_HYPOT
|
#ifndef HAVE_HYPOT
|
||||||
double hypot(double x, double y)
|
double hypot(double x, double y)
|
||||||
{
|
{
|
||||||
|
|
297
configure
vendored
297
configure
vendored
|
@ -1,5 +1,5 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# From configure.in Revision: 68599 .
|
# From configure.in Revision: 70731 .
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.61 for python 2.6.
|
# Generated by GNU Autoconf 2.61 for python 2.6.
|
||||||
#
|
#
|
||||||
|
@ -21525,6 +21525,94 @@ fi
|
||||||
LIBS_SAVE=$LIBS
|
LIBS_SAVE=$LIBS
|
||||||
LIBS="$LIBS $LIBM"
|
LIBS="$LIBS $LIBM"
|
||||||
|
|
||||||
|
# Detect whether system arithmetic is subject to x87-style double
|
||||||
|
# rounding issues. The result of this test has little meaning on non
|
||||||
|
# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding
|
||||||
|
# mode is round-to-nearest and double rounding issues are present, and
|
||||||
|
# 0 otherwise. See http://bugs.python.org/issue2937 for more info.
|
||||||
|
{ echo "$as_me:$LINENO: checking for x87-style double rounding" >&5
|
||||||
|
echo $ECHO_N "checking for x87-style double rounding... $ECHO_C" >&6; }
|
||||||
|
if test "${ac_cv_x87_double_rounding+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
|
||||||
|
if test "$cross_compiling" = yes; then
|
||||||
|
ac_cv_x87_double_rounding=no
|
||||||
|
else
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
|
int main() {
|
||||||
|
volatile double x, y, z;
|
||||||
|
/* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */
|
||||||
|
x = 0.99999999999999989; /* 1-2**-53 */
|
||||||
|
y = 1./x;
|
||||||
|
if (y != 1.)
|
||||||
|
exit(0);
|
||||||
|
/* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */
|
||||||
|
x = 1e16;
|
||||||
|
y = 2.99999;
|
||||||
|
z = x + y;
|
||||||
|
if (z != 1e16+4.)
|
||||||
|
exit(0);
|
||||||
|
/* both tests show evidence of double rounding */
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest$ac_exeext
|
||||||
|
if { (ac_try="$ac_link"
|
||||||
|
case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_link") 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
|
||||||
|
{ (case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_try") 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; }; then
|
||||||
|
ac_cv_x87_double_rounding=no
|
||||||
|
else
|
||||||
|
echo "$as_me: program exited with status $ac_status" >&5
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
( exit $ac_status )
|
||||||
|
ac_cv_x87_double_rounding=yes
|
||||||
|
fi
|
||||||
|
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
{ echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5
|
||||||
|
echo "${ECHO_T}$ac_cv_x87_double_rounding" >&6; }
|
||||||
|
if test "$ac_cv_x87_double_rounding" = yes
|
||||||
|
then
|
||||||
|
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define X87_DOUBLE_ROUNDING 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
|
# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
|
||||||
# -0. on some architectures.
|
# -0. on some architectures.
|
||||||
{ echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5
|
{ echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5
|
||||||
|
@ -21609,9 +21697,7 @@ fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p
|
||||||
|
|
||||||
for ac_func in acosh asinh atanh copysign expm1 finite hypot isinf isnan log1p
|
|
||||||
do
|
do
|
||||||
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||||
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
|
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
|
||||||
|
@ -21704,6 +21790,209 @@ _ACEOF
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
{ echo "$as_me:$LINENO: checking whether isinf is declared" >&5
|
||||||
|
echo $ECHO_N "checking whether isinf is declared... $ECHO_C" >&6; }
|
||||||
|
if test "${ac_cv_have_decl_isinf+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
#ifndef isinf
|
||||||
|
(void) isinf;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext
|
||||||
|
if { (ac_try="$ac_compile"
|
||||||
|
case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_compile") 2>conftest.er1
|
||||||
|
ac_status=$?
|
||||||
|
grep -v '^ *+' conftest.er1 >conftest.err
|
||||||
|
rm -f conftest.er1
|
||||||
|
cat conftest.err >&5
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } && {
|
||||||
|
test -z "$ac_c_werror_flag" ||
|
||||||
|
test ! -s conftest.err
|
||||||
|
} && test -s conftest.$ac_objext; then
|
||||||
|
ac_cv_have_decl_isinf=yes
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
ac_cv_have_decl_isinf=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
fi
|
||||||
|
{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5
|
||||||
|
echo "${ECHO_T}$ac_cv_have_decl_isinf" >&6; }
|
||||||
|
if test $ac_cv_have_decl_isinf = yes; then
|
||||||
|
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_DECL_ISINF 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
else
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_DECL_ISINF 0
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
{ echo "$as_me:$LINENO: checking whether isnan is declared" >&5
|
||||||
|
echo $ECHO_N "checking whether isnan is declared... $ECHO_C" >&6; }
|
||||||
|
if test "${ac_cv_have_decl_isnan+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
#ifndef isnan
|
||||||
|
(void) isnan;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext
|
||||||
|
if { (ac_try="$ac_compile"
|
||||||
|
case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_compile") 2>conftest.er1
|
||||||
|
ac_status=$?
|
||||||
|
grep -v '^ *+' conftest.er1 >conftest.err
|
||||||
|
rm -f conftest.er1
|
||||||
|
cat conftest.err >&5
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } && {
|
||||||
|
test -z "$ac_c_werror_flag" ||
|
||||||
|
test ! -s conftest.err
|
||||||
|
} && test -s conftest.$ac_objext; then
|
||||||
|
ac_cv_have_decl_isnan=yes
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
ac_cv_have_decl_isnan=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
fi
|
||||||
|
{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5
|
||||||
|
echo "${ECHO_T}$ac_cv_have_decl_isnan" >&6; }
|
||||||
|
if test $ac_cv_have_decl_isnan = yes; then
|
||||||
|
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_DECL_ISNAN 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
else
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_DECL_ISNAN 0
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
{ echo "$as_me:$LINENO: checking whether isfinite is declared" >&5
|
||||||
|
echo $ECHO_N "checking whether isfinite is declared... $ECHO_C" >&6; }
|
||||||
|
if test "${ac_cv_have_decl_isfinite+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
#ifndef isfinite
|
||||||
|
(void) isfinite;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext
|
||||||
|
if { (ac_try="$ac_compile"
|
||||||
|
case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_compile") 2>conftest.er1
|
||||||
|
ac_status=$?
|
||||||
|
grep -v '^ *+' conftest.er1 >conftest.err
|
||||||
|
rm -f conftest.er1
|
||||||
|
cat conftest.err >&5
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } && {
|
||||||
|
test -z "$ac_c_werror_flag" ||
|
||||||
|
test ! -s conftest.err
|
||||||
|
} && test -s conftest.$ac_objext; then
|
||||||
|
ac_cv_have_decl_isfinite=yes
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
ac_cv_have_decl_isfinite=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
fi
|
||||||
|
{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5
|
||||||
|
echo "${ECHO_T}$ac_cv_have_decl_isfinite" >&6; }
|
||||||
|
if test $ac_cv_have_decl_isfinite = yes; then
|
||||||
|
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_DECL_ISFINITE 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
else
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_DECL_ISFINITE 0
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LIBS=$LIBS_SAVE
|
LIBS=$LIBS_SAVE
|
||||||
|
|
||||||
|
|
41
configure.in
41
configure.in
|
@ -3145,6 +3145,44 @@ fi],
|
||||||
LIBS_SAVE=$LIBS
|
LIBS_SAVE=$LIBS
|
||||||
LIBS="$LIBS $LIBM"
|
LIBS="$LIBS $LIBM"
|
||||||
|
|
||||||
|
# Detect whether system arithmetic is subject to x87-style double
|
||||||
|
# rounding issues. The result of this test has little meaning on non
|
||||||
|
# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding
|
||||||
|
# mode is round-to-nearest and double rounding issues are present, and
|
||||||
|
# 0 otherwise. See http://bugs.python.org/issue2937 for more info.
|
||||||
|
AC_MSG_CHECKING(for x87-style double rounding)
|
||||||
|
AC_CACHE_VAL(ac_cv_x87_double_rounding, [
|
||||||
|
AC_TRY_RUN([
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
|
int main() {
|
||||||
|
volatile double x, y, z;
|
||||||
|
/* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */
|
||||||
|
x = 0.99999999999999989; /* 1-2**-53 */
|
||||||
|
y = 1./x;
|
||||||
|
if (y != 1.)
|
||||||
|
exit(0);
|
||||||
|
/* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */
|
||||||
|
x = 1e16;
|
||||||
|
y = 2.99999;
|
||||||
|
z = x + y;
|
||||||
|
if (z != 1e16+4.)
|
||||||
|
exit(0);
|
||||||
|
/* both tests show evidence of double rounding */
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
],
|
||||||
|
ac_cv_x87_double_rounding=no,
|
||||||
|
ac_cv_x87_double_rounding=yes,
|
||||||
|
ac_cv_x87_double_rounding=no)])
|
||||||
|
AC_MSG_RESULT($ac_cv_x87_double_rounding)
|
||||||
|
if test "$ac_cv_x87_double_rounding" = yes
|
||||||
|
then
|
||||||
|
AC_DEFINE(X87_DOUBLE_ROUNDING, 1,
|
||||||
|
[Define if arithmetic is subject to x87-style double rounding issue])
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
|
# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
|
||||||
# -0. on some architectures.
|
# -0. on some architectures.
|
||||||
AC_MSG_CHECKING(whether tanh preserves the sign of zero)
|
AC_MSG_CHECKING(whether tanh preserves the sign of zero)
|
||||||
|
@ -3171,7 +3209,8 @@ then
|
||||||
[Define if tanh(-0.) is -0., or if platform doesn't have signed zeros])
|
[Define if tanh(-0.) is -0., or if platform doesn't have signed zeros])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot isinf isnan log1p])
|
AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot log1p])
|
||||||
|
AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]])
|
||||||
|
|
||||||
LIBS=$LIBS_SAVE
|
LIBS=$LIBS_SAVE
|
||||||
|
|
||||||
|
|
|
@ -115,6 +115,18 @@
|
||||||
/* Define if you have the 'resize_term' function. */
|
/* Define if you have the 'resize_term' function. */
|
||||||
#undef HAVE_CURSES_RESIZE_TERM
|
#undef HAVE_CURSES_RESIZE_TERM
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `isfinite', and to 0 if you
|
||||||
|
don't. */
|
||||||
|
#undef HAVE_DECL_ISFINITE
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't.
|
||||||
|
*/
|
||||||
|
#undef HAVE_DECL_ISINF
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
|
||||||
|
*/
|
||||||
|
#undef HAVE_DECL_ISNAN
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
|
/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
|
||||||
*/
|
*/
|
||||||
#undef HAVE_DECL_TZNAME
|
#undef HAVE_DECL_TZNAME
|
||||||
|
@ -315,12 +327,6 @@
|
||||||
/* Define to 1 if you have the <io.h> header file. */
|
/* Define to 1 if you have the <io.h> header file. */
|
||||||
#undef HAVE_IO_H
|
#undef HAVE_IO_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `isinf' function. */
|
|
||||||
#undef HAVE_ISINF
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `isnan' function. */
|
|
||||||
#undef HAVE_ISNAN
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `kill' function. */
|
/* Define to 1 if you have the `kill' function. */
|
||||||
#undef HAVE_KILL
|
#undef HAVE_KILL
|
||||||
|
|
||||||
|
@ -360,7 +366,7 @@
|
||||||
/* Define to 1 if you have the <libintl.h> header file. */
|
/* Define to 1 if you have the <libintl.h> header file. */
|
||||||
#undef HAVE_LIBINTL_H
|
#undef HAVE_LIBINTL_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `readline' library (-lreadline). */
|
/* Define if you have the readline library (-lreadline). */
|
||||||
#undef HAVE_LIBREADLINE
|
#undef HAVE_LIBREADLINE
|
||||||
|
|
||||||
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
||||||
|
@ -983,6 +989,9 @@
|
||||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||||
#undef WORDS_BIGENDIAN
|
#undef WORDS_BIGENDIAN
|
||||||
|
|
||||||
|
/* Define if arithmetic is subject to x87-style double rounding issue */
|
||||||
|
#undef X87_DOUBLE_ROUNDING
|
||||||
|
|
||||||
/* Define to 1 if on AIX 3.
|
/* Define to 1 if on AIX 3.
|
||||||
System headers sometimes define this.
|
System headers sometimes define this.
|
||||||
We just want to avoid a redefinition error message. */
|
We just want to avoid a redefinition error message. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue