This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
IRIX long-double sqrt(2) one bit error in the least significant end.
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 19 Oct 2015 11:10:45 +0000 (07:10 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 19 Oct 2015 13:08:38 +0000 (09:08 -0400)
t/op/sprintf2.t

index 023167b..a898df1 100644 (file)
@@ -577,6 +577,7 @@ is $o::count,    0, 'sprintf %d string overload count is 0';
 is $o::numcount, 1, 'sprintf %d number overload count is 1';
 
 my $ppc64_linux = $Config{archname} =~ /^ppc64-linux/;
+my $irix_ld     = $Config{archname} =~ /^IP\d+-irix-ld$/;
 
 for my $t (@hexfloat) {
     my ($format, $arg, $expected) = @$t;
@@ -589,6 +590,15 @@ for my $t (@hexfloat) {
         ok($ok, "'$format' '$arg' -> '$result' cf '$expected'");
         next;
     }
+    if ($doubledouble && $irix_ld && $arg =~ /^1.41421/) {
+        # irix has buggy sqrt(2),
+        # last hexdigit one bit error:
+        # gets  '0x1.6a09e667f3bcc908b2fb1366eacp+0'
+        # wants '0x1.6a09e667f3bcc908b2fb1366ea8p+0'
+        local $::TODO = "$Config{archname} sqrt(2)";
+        ok($ok, "'$format' '$arg' -> '$result' cf '$expected'");
+        next;
+    }
     unless ($ok) {
         # It seems that there can be difference in the last bits:
         # [perl #122578]