summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorJens Hamisch <jens@Strawberry.COM>2000-10-17 10:39:36 +0200
committerJarkko Hietaniemi <jhi@iki.fi>2000-10-20 19:15:54 +0000
commit1048ea30476937814737f4fb47f5b4cb2620fbb6 (patch)
tree51ef4ee006daee524693f7c7f6d131fb027458a4 /pp.c
parentd1ee8ea942531922f62d42196a4beaeb1f71ab86 (diff)
downloadperl-1048ea30476937814737f4fb47f5b4cb2620fbb6.tar.gz
Don't write double values through long double pointers,
based on a part of Subject: [ID 20001016.017] [jens: 5.7.0 Solaris 8, 64 Bit, Workshop 6.0 Compiler] Message-Id: <20001017083936.A11104@Strawberry.COM> p4raw-id: //depot/perl@7380
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/pp.c b/pp.c
index 9afa96dd03..98d31cb05e 100644
--- a/pp.c
+++ b/pp.c
@@ -1889,11 +1889,24 @@ PP(pp_int)
SETi(iv);
}
else {
- if (value >= 0.0)
- (void)Perl_modf(value, &value);
+ if (value >= 0.0) {
+#if defined(HAS_MODFL) || defined(LONG_DOUBLE_EQUALS_DOUBLE)
+ (void)Perl_modf(value, &value);
+#else
+ double tmp = (double)value;
+ (void)Perl_modf(tmp, &tmp);
+ value = (NV)tmp;
+#endif
+ }
else {
- (void)Perl_modf(-value, &value);
- value = -value;
+#if defined(HAS_MODFL) || defined(LONG_DOUBLE_EQUALS_DOUBLE)
+ (void)Perl_modf(-value, &value);
+ value = -value;
+#else
+ double tmp = (double)value;
+ (void)Perl_modf(-tmp, &tmp);
+ value = -(NV)tmp;
+#endif
}
iv = I_V(value);
if (iv == value)