diff options
author | Sisyphus <sisyphus1@optusnet.com.au> | 2015-08-20 07:28:33 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2015-08-20 08:22:01 -0400 |
commit | 09b94b1f0efd8c107548a6fefcd471e9b06c2cdf (patch) | |
tree | c8b7ab367512dfe960c3382469cb228705f368fb /pp_pack.c | |
parent | 89afeb4776894908ce75f4b808087ff12a4bc7b5 (diff) | |
download | perl-09b94b1f0efd8c107548a6fefcd471e9b06c2cdf.tar.gz |
[perl #125669] op/pack.t failures with PPC long double (double double) builds
unpack '%65...' failures, to be more exact.
Diffstat (limited to 'pp_pack.c')
-rw-r--r-- | pp_pack.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -1767,7 +1767,18 @@ S_unpack_rec(pTHX_ tempsym_t* symptr, const char *s, const char *strbeg, const c } while (cdouble < 0.0) cdouble += anv; - cdouble = Perl_modf(cdouble / anv, &trouble) * anv; + cdouble = Perl_modf(cdouble / anv, &trouble); +#ifdef LONGDOUBLE_DOUBLEDOUBLE + /* Workaround for powerpc doubledouble modfl bug: + * close to 1.0L and -1.0L cdouble is 0, and trouble + * is cdouble / anv. */ + if (trouble != Perl_ceil(trouble)) { + cdouble = trouble; + if (cdouble > 1.0L) cdouble -= 1.0L; + if (cdouble < -1.0L) cdouble += 1.0L; + } +#endif + cdouble *= anv; sv = newSVnv(cdouble); } else { |