summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl
diff options
context:
space:
mode:
authorAndrew Fresh <afresh1@cvs.openbsd.org>2021-03-01 23:15:31 +0000
committerAndrew Fresh <afresh1@cvs.openbsd.org>2021-03-01 23:15:31 +0000
commitba0a4121213afa3ad8e0fc7b2242888a6f0b94e7 (patch)
tree63d7fefdd318c2c8753caad34f5035adff14c771 /gnu/usr.bin/perl
parent1fb4557b23c14b9dfd0b80245140aaf08240255b (diff)
Import perl-5.32.1
OK sthen@
Diffstat (limited to 'gnu/usr.bin/perl')
-rw-r--r--gnu/usr.bin/perl/cpan/Math-BigInt/t/backermann-mbi.t2
-rw-r--r--gnu/usr.bin/perl/cpan/Math-BigInt/t/bdigitsum-mbi.t2
-rw-r--r--gnu/usr.bin/perl/cpan/Math-BigInt/t/buparrow-mbi.t2
-rw-r--r--gnu/usr.bin/perl/cpan/Math-BigInt/t/from_ieee754-mbf.t2
-rw-r--r--gnu/usr.bin/perl/cpan/Math-BigInt/t/to_ieee754-mbf.t103
5 files changed, 7 insertions, 104 deletions
diff --git a/gnu/usr.bin/perl/cpan/Math-BigInt/t/backermann-mbi.t b/gnu/usr.bin/perl/cpan/Math-BigInt/t/backermann-mbi.t
index cc32dd1df01..45fcac6dbd2 100644
--- a/gnu/usr.bin/perl/cpan/Math-BigInt/t/backermann-mbi.t
+++ b/gnu/usr.bin/perl/cpan/Math-BigInt/t/backermann-mbi.t
@@ -1,4 +1,4 @@
-# -*- mode: perl; -*-
+#!perl
use strict;
use warnings;
diff --git a/gnu/usr.bin/perl/cpan/Math-BigInt/t/bdigitsum-mbi.t b/gnu/usr.bin/perl/cpan/Math-BigInt/t/bdigitsum-mbi.t
index 0991191317f..45c9bd72565 100644
--- a/gnu/usr.bin/perl/cpan/Math-BigInt/t/bdigitsum-mbi.t
+++ b/gnu/usr.bin/perl/cpan/Math-BigInt/t/bdigitsum-mbi.t
@@ -1,4 +1,4 @@
-# -*- mode: perl; -*-
+#!perl
use strict;
use warnings;
diff --git a/gnu/usr.bin/perl/cpan/Math-BigInt/t/buparrow-mbi.t b/gnu/usr.bin/perl/cpan/Math-BigInt/t/buparrow-mbi.t
index f2583418f9b..c2eb2eec614 100644
--- a/gnu/usr.bin/perl/cpan/Math-BigInt/t/buparrow-mbi.t
+++ b/gnu/usr.bin/perl/cpan/Math-BigInt/t/buparrow-mbi.t
@@ -1,4 +1,4 @@
-# -*- mode: perl; -*-
+#!perl
use strict;
use warnings;
diff --git a/gnu/usr.bin/perl/cpan/Math-BigInt/t/from_ieee754-mbf.t b/gnu/usr.bin/perl/cpan/Math-BigInt/t/from_ieee754-mbf.t
index 8edb904ba48..99dd6e1e071 100644
--- a/gnu/usr.bin/perl/cpan/Math-BigInt/t/from_ieee754-mbf.t
+++ b/gnu/usr.bin/perl/cpan/Math-BigInt/t/from_ieee754-mbf.t
@@ -1,4 +1,4 @@
-# -*- mode: perl; -*-
+#!perl
use strict;
use warnings;
diff --git a/gnu/usr.bin/perl/cpan/Math-BigInt/t/to_ieee754-mbf.t b/gnu/usr.bin/perl/cpan/Math-BigInt/t/to_ieee754-mbf.t
index 9dbfa092cbf..1f043f9ea6a 100644
--- a/gnu/usr.bin/perl/cpan/Math-BigInt/t/to_ieee754-mbf.t
+++ b/gnu/usr.bin/perl/cpan/Math-BigInt/t/to_ieee754-mbf.t
@@ -1,9 +1,9 @@
-# -*- mode: perl; -*-
+#!perl
use strict;
use warnings;
-use Test::More tests => 66;
+use Test::More tests => 60;
use Math::BigFloat;
@@ -189,7 +189,7 @@ for my $k (@k) {
note("\n", $entry -> {dsc}, " (k = $k): ", $entry -> {asc}, "\n\n");
- my $x = $entry -> {mbf};
+ my $x = Math::BigFloat -> new($entry -> {mbf});
my $test = qq|Math::BigFloat -> new("| . stringify($x)
. qq|") -> to_ieee754("$format")|;
@@ -204,100 +204,3 @@ for my $k (@k) {
is($got_hex, $expected_hex);
}
}
-
-# These tests verify fixing CPAN RT #139960.
-
-# binary16
-
-{
- # largest subnormal number
- my $lo = Math::BigFloat -> from_ieee754("03ff", "binary16");
-
- # smallest normal number
- my $hi = Math::BigFloat -> from_ieee754("0400", "binary16");
-
- # compute an average weighted towards the larger of the two
- my $x = 0.25 * $lo + 0.75 * $hi;
-
- my $got = unpack "H*", $x -> to_ieee754("binary16");
- is($got, "0400",
- "6.102025508880615234375e-5 -> 0x0400");
-}
-
-{
- # largest number smaller than one
- my $lo = Math::BigFloat -> from_ieee754("3bff", "binary16");
-
- # one
- my $hi = Math::BigFloat -> from_ieee754("3c00", "binary16");
-
- # compute an average weighted towards the larger of the two
- my $x = 0.25 * $lo + 0.75 * $hi;
-
- my $got = unpack "H*", $x -> to_ieee754("binary16");
- is($got, "3c00", "9.998779296875e-1 -> 0x3c00");
-}
-
-# binary32
-
-{
- # largest subnormal number
- my $lo = Math::BigFloat -> from_ieee754("007fffff", "binary32");
-
- # smallest normal number
- my $hi = Math::BigFloat -> from_ieee754("00800000", "binary32");
-
- # compute an average weighted towards the larger of the two
- my $x = 0.25 * $lo + 0.75 * $hi;
-
- my $got = unpack "H*", $x -> to_ieee754("binary32");
- is($got, "00800000",
- "1.1754943157898258998483097641290060955707622747...e-38 -> 0x00800000");
-}
-
-{
- # largest number smaller than one
- my $lo = Math::BigFloat -> from_ieee754("3f7fffff", "binary32");
-
- # one
- my $hi = Math::BigFloat -> from_ieee754("3f800000", "binary32");
-
- # compute an average weighted towards the larger of the two
- my $x = 0.25 * $lo + 0.75 * $hi;
-
- my $got = unpack "H*", $x -> to_ieee754("binary32");
- is($got, "3f800000",
- "9.9999998509883880615234375e-1 -> 0x3f800000");
-}
-
-# binary64
-
-{
- # largest subnormal number
- my $lo = Math::BigFloat -> from_ieee754("000fffffffffffff", "binary64");
-
- # smallest normal number
- my $hi = Math::BigFloat -> from_ieee754("0010000000000000", "binary64");
-
- # compute an average weighted towards the larger of the two
- my $x = 0.25 * $lo + 0.75 * $hi;
-
- my $got = unpack "H*", $x -> to_ieee754("binary64");
- is($got, "0010000000000000",
- "2.2250738585072012595738212570207680200...e-308 -> 0x0010000000000000");
-}
-
-{
- # largest number smaller than one
- my $lo = Math::BigFloat -> from_ieee754("3fefffffffffffff", "binary64");
-
- # one
- my $hi = Math::BigFloat -> from_ieee754("3ff0000000000000", "binary64");
-
- # compute an average weighted towards the larger of the two
- my $x = 0.25 * $lo + 0.75 * $hi;
-
- my $got = unpack "H*", $x -> to_ieee754("binary64");
- is($got, "3ff0000000000000",
- "9.999999999999999722444243843710864894092...e-1 -> 0x3ff0000000000000");
-}