summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-08-05 23:07:50 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-08-05 23:07:50 +0000
commita24374368d9ca399370d0bbf60ebc0aa16225436 (patch)
tree9574821e74c16e180f32e8f8cb08c3c18138f309 /numeric.c
parent574bacfe464e67c186e160f356e339f5a9faa3e8 (diff)
downloadperl-a24374368d9ca399370d0bbf60ebc0aa16225436.tar.gz
Avoid SIGFPE in Tru64.
p4raw-id: //depot/perl@11592
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index e7a5e8d7e6..8d94975f1d 100644
--- a/numeric.c
+++ b/numeric.c
@@ -580,6 +580,11 @@ S_mulexp10(NV value, I32 exponent)
return NV_MAX;
# endif
#endif
+#if defined(__alpha) && defined(__unix__)
+ if (!negative &&
+ (log10(value) + exponent) >= (DBL_MAX_10_EXP))
+ return NV_INF;
+#endif
for (bit = 1; exponent; bit <<= 1) {
if (exponent & bit) {
exponent ^= bit;