diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-08 14:15:32 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-08 14:15:32 +0000 |
commit | e67aeab17662a70a2316911b8ee5b43fdf6f7241 (patch) | |
tree | e3eca0ad4b75893ddf06d7df92e3888695fd4454 /pp.c | |
parent | c6966feaee0c3ed89d8fc30ec44b30cc2c61c5fc (diff) | |
download | perl-e67aeab17662a70a2316911b8ee5b43fdf6f7241.tar.gz |
Be inspired more by Hugo-- introduce HAS_MODFL_POW32_BUG.
p4raw-id: //depot/perl@10479
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -2598,7 +2598,16 @@ PP(pp_int) SETu(U_V(value)); } else { #if defined(HAS_MODFL) || defined(LONG_DOUBLE_EQUALS_DOUBLE) +# ifdef 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 #else double tmp = (double)value; (void)Perl_modf(tmp, &tmp); @@ -2612,7 +2621,16 @@ PP(pp_int) SETi(I_V(value)); } else { #if defined(HAS_MODFL) || defined(LONG_DOUBLE_EQUALS_DOUBLE) +# ifdef 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 value = -value; #else double tmp = (double)value; |