diff options
author | Jens Hamisch <jens@Strawberry.COM> | 2000-10-17 10:39:36 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-20 19:15:54 +0000 |
commit | 1048ea30476937814737f4fb47f5b4cb2620fbb6 (patch) | |
tree | 51ef4ee006daee524693f7c7f6d131fb027458a4 /pp.c | |
parent | d1ee8ea942531922f62d42196a4beaeb1f71ab86 (diff) | |
download | perl-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.c | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -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) |