Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 865c17f

Browse files
authored
closes bpo-34640: Remove the TANH_PRESERVES_ZERO_SIGN configure check. (GH-9206)
1 parent 7f0d59f commit 865c17f

5 files changed

Lines changed: 0 additions & 81 deletions

File tree

Lib/test/test_cmath.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,6 @@ def test_isinf(self):
577577
self.assertTrue(cmath.isinf(complex(INF, NAN)))
578578

579579
@requires_IEEE_754
580-
@unittest.skipIf(sysconfig.get_config_var('TANH_PRESERVES_ZERO_SIGN') == 0,
581-
"system tanh() function doesn't copy the sign")
582580
def testTanhSign(self):
583581
for z in complex_zeros:
584582
self.assertComplexIdentical(cmath.tanh(z), z)

Lib/test/test_math.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,8 +1355,6 @@ def testTanh(self):
13551355
self.assertTrue(math.isnan(math.tanh(NAN)))
13561356

13571357
@requires_IEEE_754
1358-
@unittest.skipIf(sysconfig.get_config_var('TANH_PRESERVES_ZERO_SIGN') == 0,
1359-
"system tanh() function doesn't copy the sign")
13601358
def testTanhSign(self):
13611359
# check that tanh(-0.) == -0. on IEEE 754 systems
13621360
self.assertEqual(math.tanh(-0.), -0.)

configure

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -14163,53 +14163,6 @@ cat >>confdefs.h <<_ACEOF
1416314163
_ACEOF
1416414164

1416514165

14166-
# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
14167-
# -0. on some architectures.
14168-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tanh preserves the sign of zero" >&5
14169-
$as_echo_n "checking whether tanh preserves the sign of zero... " >&6; }
14170-
if ${ac_cv_tanh_preserves_zero_sign+:} false; then :
14171-
$as_echo_n "(cached) " >&6
14172-
else
14173-
14174-
if test "$cross_compiling" = yes; then :
14175-
ac_cv_tanh_preserves_zero_sign=no
14176-
else
14177-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14178-
/* end confdefs.h. */
14179-
14180-
#include <math.h>
14181-
#include <stdlib.h>
14182-
int main() {
14183-
/* return 0 if either negative zeros don't exist
14184-
on this platform or if negative zeros exist
14185-
and tanh(-0.) == -0. */
14186-
if (atan2(0., -1.) == atan2(-0., -1.) ||
14187-
atan2(tanh(-0.), -1.) == atan2(-0., -1.)) exit(0);
14188-
else exit(1);
14189-
}
14190-
14191-
_ACEOF
14192-
if ac_fn_c_try_run "$LINENO"; then :
14193-
ac_cv_tanh_preserves_zero_sign=yes
14194-
else
14195-
ac_cv_tanh_preserves_zero_sign=no
14196-
fi
14197-
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14198-
conftest.$ac_objext conftest.beam conftest.$ac_ext
14199-
fi
14200-
14201-
fi
14202-
14203-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tanh_preserves_zero_sign" >&5
14204-
$as_echo "$ac_cv_tanh_preserves_zero_sign" >&6; }
14205-
if test "$ac_cv_tanh_preserves_zero_sign" = yes
14206-
then
14207-
14208-
$as_echo "#define TANH_PRESERVES_ZERO_SIGN 1" >>confdefs.h
14209-
14210-
fi
14211-
LIBS=$LIBS_SAVE
14212-
1421314166
# For multiprocessing module, check that sem_open
1421414167
# actually works. For FreeBSD versions <= 7.2,
1421514168
# the kernel module that provides POSIX semaphores

configure.ac

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4359,33 +4359,6 @@ AC_CHECK_FUNCS([acosh asinh atanh copysign erf erfc expm1 finite gamma])
43594359
AC_CHECK_FUNCS([hypot lgamma log1p log2 round tgamma])
43604360
AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]])
43614361

4362-
# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
4363-
# -0. on some architectures.
4364-
AC_MSG_CHECKING(whether tanh preserves the sign of zero)
4365-
AC_CACHE_VAL(ac_cv_tanh_preserves_zero_sign, [
4366-
AC_RUN_IFELSE([AC_LANG_SOURCE([[
4367-
#include <math.h>
4368-
#include <stdlib.h>
4369-
int main() {
4370-
/* return 0 if either negative zeros don't exist
4371-
on this platform or if negative zeros exist
4372-
and tanh(-0.) == -0. */
4373-
if (atan2(0., -1.) == atan2(-0., -1.) ||
4374-
atan2(tanh(-0.), -1.) == atan2(-0., -1.)) exit(0);
4375-
else exit(1);
4376-
}
4377-
]])],
4378-
[ac_cv_tanh_preserves_zero_sign=yes],
4379-
[ac_cv_tanh_preserves_zero_sign=no],
4380-
[ac_cv_tanh_preserves_zero_sign=no])])
4381-
AC_MSG_RESULT($ac_cv_tanh_preserves_zero_sign)
4382-
if test "$ac_cv_tanh_preserves_zero_sign" = yes
4383-
then
4384-
AC_DEFINE(TANH_PRESERVES_ZERO_SIGN, 1,
4385-
[Define if tanh(-0.) is -0., or if platform doesn't have signed zeros])
4386-
fi
4387-
LIBS=$LIBS_SAVE
4388-
43894362
# For multiprocessing module, check that sem_open
43904363
# actually works. For FreeBSD versions <= 7.2,
43914364
# the kernel module that provides POSIX semaphores

pyconfig.h.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,9 +1419,6 @@
14191419
(which you can't on SCO ODT 3.0). */
14201420
#undef SYS_SELECT_WITH_SYS_TIME
14211421

1422-
/* Define if tanh(-0.) is -0., or if platform doesn't have signed zeros */
1423-
#undef TANH_PRESERVES_ZERO_SIGN
1424-
14251422
/* Library needed by timemodule.c: librt may be needed for clock_gettime() */
14261423
#undef TIMEMODULE_LIB
14271424

0 commit comments

Comments
 (0)