In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/9e67a8c1b21482ed5fada053dd462eb23320dc86?hp=06ccdc0cc07d34934eaa2b248a061504e584c780>

- Log -----------------------------------------------------------------
commit 9e67a8c1b21482ed5fada053dd462eb23320dc86
Author: Jarkko Hietaniemi <[email protected]>
Date:   Fri Aug 12 19:08:56 2016 -0400

    Avoid test noise on non-longdouble.

M       t/op/sprintf2.t

commit ee58923a8531731f8acb98ab130abf41f75ebdc7
Author: Jarkko Hietaniemi <[email protected]>
Date:   Fri Aug 12 17:36:58 2016 -0400

    [rt.perl.org #128909] printf %a mishandles exponent-crossing rounding with 
long double

M       sv.c
M       t/op/sprintf2.t

commit 44348173fce5aaf28fdf59ba6ace73ea435d9380
Author: Jarkko Hietaniemi <[email protected]>
Date:   Fri Aug 12 17:30:25 2016 -0400

    Bogus skip count.
    
    Didn't break anything but still bogus.

M       t/op/sprintf2.t
-----------------------------------------------------------------------

Summary of changes:
 sv.c            |  6 ++++--
 t/op/sprintf2.t | 11 ++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/sv.c b/sv.c
index ae70d7b..467af34 100644
--- a/sv.c
+++ b/sv.c
@@ -12549,12 +12549,14 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char 
*const pat, const STRLEN p
                                         break;
                                     }
                                 }
-                                if (v == v0 && overflow) {
+                                if (v == v0 - 1 && overflow) {
                                     /* If the overflow goes all the
                                      * way to the front, we need to
-                                     * insert 0x1 in front. */
+                                     * insert 0x1 in front, and adjust
+                                     * the argument. */
                                     Move(v0, v0 + 1, vn, char);
                                     *v0 = 0x1;
+                                    exponent += 4;
                                 }
                             }
 
diff --git a/t/op/sprintf2.t b/t/op/sprintf2.t
index 52bb23c..fe1bac9 100644
--- a/t/op/sprintf2.t
+++ b/t/op/sprintf2.t
@@ -21,7 +21,7 @@ print "# uvsize = $Config{uvsize}\n";
 print "# nvsize = $Config{nvsize}\n";
 print "# nv_preserves_uv_bits = $Config{nv_preserves_uv_bits}\n";
 print "# d_quad = $Config{d_quad}\n";
-print "# uselongdouble = $Config{uselongdouble}\n";
+print "# uselongdouble = " . ($Config{uselongdouble} // 'undef') . "\n";
 if ($Config{nvsize} == 8 &&
     (
      # IEEE-754 64-bit ("double precision"), the most common out there
@@ -849,9 +849,9 @@ SKIP: {
 }
 
 # x86 80-bit long-double tests for
-# rt.perl.org #128843, #128888, #128889, #128890, #128893
+# rt.perl.org #128843, #128888, #128889, #128890, #128893, #128909
 SKIP: {
-    skip("non-80-bit-long-double", scalar @subnormals + 34)
+    skip("non-80-bit-long-double", 12)
         unless ($Config{uselongdouble} &&
                ($Config{nvsize} == 16 || $Config{nvsize} == 12) &&
                ($Config{longdblkind} == 3 ||
@@ -864,6 +864,11 @@ SKIP: {
     is(sprintf("%020a", -1.5), "-0x0000000000000cp-3", "[rt.perl.org 
#128893]");
     is(sprintf("%+020a", 1.5), "+0x0000000000000cp-3", "[rt.perl.org 
#128893]");
     is(sprintf("% 020a", 1.5), " 0x0000000000000cp-3", "[rt.perl.org 
#128893]");
+    is(sprintf("%a", 1.9999999999999999999), "0xf.fffffffffffffffp-3");
+    is(sprintf("%.3a", 1.9999999999999999999), "0x1.000p+1", "[rt.perl.org 
#128909]");
+    is(sprintf("%.2a", 1.9999999999999999999), "0x1.00p+1");
+    is(sprintf("%.1a", 1.9999999999999999999), "0x1.0p+1");
+    is(sprintf("%.0a", 1.9999999999999999999), "0x1p+1");
 }
 
 done_testing();

--
Perl5 Master Repository

Reply via email to