summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2003-08-27 23:59:55 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-29 17:22:11 +0000
commit059a10146419a6f49976e2c5f746a49407194e27 (patch)
tree3def2f31774dbdf2dec2969e099e2d0dff6b2964 /pp.c
parent4c496f0cc0d05e588e924cab74c61dfe12f0f2cb (diff)
downloadperl-059a10146419a6f49976e2c5f746a49407194e27.tar.gz
Re: all 9007199254740992s are equal, but some are more equal than others
Message-ID: <20030827225955.E558@plum.flirble.org> p4raw-id: //depot/perl@20937
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c47
1 files changed, 3 insertions, 44 deletions
diff --git a/pp.c b/pp.c
index 22405bf20e..5cb176ff23 100644
--- a/pp.c
+++ b/pp.c
@@ -2772,28 +2772,6 @@ PP(pp_sqrt)
}
}
-/*
- * There are strange code-generation bugs caused on sparc64 by gcc-2.95.2.
- * These need to be revisited when a newer toolchain becomes available.
- */
-#if defined(__sparc64__) && defined(__GNUC__)
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
-# undef SPARC64_MODF_WORKAROUND
-# define SPARC64_MODF_WORKAROUND 1
-# endif
-#endif
-
-#if defined(SPARC64_MODF_WORKAROUND)
-static NV
-sparc64_workaround_modf(NV theVal, NV *theIntRes)
-{
- NV res, ret;
- ret = Perl_modf(theVal, &res);
- *theIntRes = res;
- return ret;
-}
-#endif
-
PP(pp_int)
{
dSP; dTARGET; tryAMAGICun(int);
@@ -2817,34 +2795,15 @@ PP(pp_int)
if (value < (NV)UV_MAX + 0.5) {
SETu(U_V(value));
} else {
-#if defined(SPARC64_MODF_WORKAROUND)
- (void)sparc64_workaround_modf(value, &value);
-#elif defined(HAS_MODFL_POW32_BUG)
-/* some versions of glibc split (i + d) into (i-1, d+1) for 2^32 <= i < 2^64 */
- NV offset = Perl_modf(value, &value);
- (void)Perl_modf(offset, &offset);
- value += offset;
-#else
- (void)Perl_modf(value, &value);
-#endif
- SETn(value);
+ SETn(Perl_floor(value));
}
}
else {
if (value > (NV)IV_MIN - 0.5) {
SETi(I_V(value));
} else {
-#if defined(SPARC64_MODF_WORKAROUND)
- (void)sparc64_workaround_modf(-value, &value);
-#elif defined(HAS_MODFL_POW32_BUG)
-/* some versions of glibc split (i + d) into (i-1, d+1) for 2^32 <= i < 2^64 */
- NV offset = Perl_modf(-value, &value);
- (void)Perl_modf(offset, &offset);
- value += offset;
-#else
- (void)Perl_modf(-value, &value);
-#endif
- SETn(-value);
+ /* This is maint, and we don't have Perl_ceil in perl.h */
+ SETn(-Perl_floor(-value));
}
}
}