In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/09b94b1f0efd8c107548a6fefcd471e9b06c2cdf?hp=89afeb4776894908ce75f4b808087ff12a4bc7b5>

- Log -----------------------------------------------------------------
commit 09b94b1f0efd8c107548a6fefcd471e9b06c2cdf
Author: Sisyphus <[email protected]>
Date:   Thu Aug 20 07:28:33 2015 -0400

    [perl #125669] op/pack.t failures with PPC long double (double double) 
builds
    
    unpack '%65...' failures, to be more exact.
-----------------------------------------------------------------------

Summary of changes:
 pp_pack.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/pp_pack.c b/pp_pack.c
index b1a0d85..8d7f1e2 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -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 {

--
Perl5 Master Repository

Reply via email to