aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2008-04-21 22:32:24 +0000
committerMark Dickinson <dickinsm@gmail.com>2008-04-21 22:32:24 +0000
commit265d7384b9e9cd32630ae28b05f04c1bc4fd9133 (patch)
tree67ceaf50b6965d456cfc60bf1bdb9a69e322f30a /configure.in
parentIf sys.stdin is not a tty, fall back to default_getpass after printing (diff)
downloadcpython-265d7384b9e9cd32630ae28b05f04c1bc4fd9133.tar.gz
cpython-265d7384b9e9cd32630ae28b05f04c1bc4fd9133.tar.bz2
cpython-265d7384b9e9cd32630ae28b05f04c1bc4fd9133.zip
test_math and test_cmath are failing on the FreeBSD 6.2 trunk buildbot,
apparently because tanh(-0.) loses the sign of zero on that platform. If true, this is a bug in FreeBSD. Added a configure test to verify this. I still need to figure out how best to deal with this failure.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in26
1 files changed, 26 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 05dd87ad52a..4d723216b68 100644
--- a/configure.in
+++ b/configure.in
@@ -2994,6 +2994,32 @@ fi],
# ************************************
# * Check for mathematical functions *
# ************************************
+
+# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
+# -0. on some architectures.
+AC_MSG_CHECKING(whether tanh preserves the sign of zero)
+AC_CACHE_VAL(ac_cv_tanh_preserves_zero_sign, [
+AC_TRY_RUN([
+#include <math.h>
+int main() {
+ /* return 0 if either negative zeros don't exist
+ on this platform or if negative zeros exist
+ and tanh(-0.) == -0. */
+ if (atan2(0., -1.) == atan2(-0., -1.) ||
+ atan2(tanh(-0.), -1.) == atan2(-0., -1.)) exit(0);
+ else exit(1);
+}
+],
+ac_cv_tanh_preserves_zero_sign=yes,
+ac_cv_tanh_preserves_zero_sign=no,
+ac_cv_tanh_preserves_zero_sign=no)])
+AC_MSG_RESULT($ac_cv_tanh_preserves_zero_sign)
+if test "$ac_cv_tanh_preserves_zero_sign" = yes
+then
+ AC_DEFINE(TANH_PRESERVES_ZERO_SIGN, 1,
+ [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros])
+fi
+
LIBS_SAVE=$LIBS
LIBS="$LIBS $LIBM"
AC_REPLACE_FUNCS(hypot)