diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-02-03 13:10:39 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-02-03 13:10:39 +0000 |
commit | b57c8994d18dca212b1e1f9547c24fffd7deff90 (patch) | |
tree | 35f36f181007389f80a44edf923e774b88c988af /lib | |
parent | 98deaf8b6f81f2134325cdb77e2cb53eef33afb3 (diff) | |
download | perl-b57c8994d18dca212b1e1f9547c24fffd7deff90.tar.gz |
Upgrade to Math::Complex 1.48 and Math::Trig 1.13
p4raw-id: //depot/perl@33222
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Math/Complex.pm | 9 | ||||
-rwxr-xr-x | lib/Math/Complex.t | 2 | ||||
-rw-r--r-- | lib/Math/Trig.pm | 4 | ||||
-rwxr-xr-x | lib/Math/Trig.t | 9 |
4 files changed, 13 insertions, 11 deletions
diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm index 36dc1ea6b8..819a63d77a 100644 --- a/lib/Math/Complex.pm +++ b/lib/Math/Complex.pm @@ -9,7 +9,7 @@ package Math::Complex; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $Inf); -$VERSION = 1.47; +$VERSION = 1.48; BEGIN { # For 64-bit doubles, anyway. @@ -41,6 +41,7 @@ BEGIN { $Inf = $IEEE_DBL_MAX unless defined $Inf; # Oh well, close enough. die "Could not get Infinity" unless $Inf > 1e99; } + print "# On this machine, Inf = '$Inf'\n"; } use strict; @@ -1408,7 +1409,7 @@ sub _stringify_cartesian { if ($x =~ /^NaN[QS]?$/i) { $re = $x; } else { - if ($x =~ /^-?$Inf$/oi) { + if ($x =~ /^-?\Q$Inf\E$/oi) { $re = $x; } else { $re = defined $format ? sprintf($format, $x) : $x; @@ -1422,7 +1423,7 @@ sub _stringify_cartesian { if ($y =~ /^(NaN[QS]?)$/i) { $im = $y; } else { - if ($y =~ /^-?$Inf$/oi) { + if ($y =~ /^-?\Q$Inf\E$/oi) { $im = $y; } else { $im = @@ -1466,7 +1467,7 @@ sub _stringify_polar { my %format = $z->display_format; my $format = $format{format}; - if ($t =~ /^NaN[QS]?$/i || $t =~ /^-?$Inf$/oi) { + if ($t =~ /^NaN[QS]?$/i || $t =~ /^-?\Q$Inf\E$/oi) { $theta = $t; } elsif ($t == pi) { $theta = "pi"; diff --git a/lib/Math/Complex.t b/lib/Math/Complex.t index cbd5ed353d..c9143316c6 100755 --- a/lib/Math/Complex.t +++ b/lib/Math/Complex.t @@ -13,7 +13,7 @@ BEGIN { } } -use Math::Complex 1.47; +use Math::Complex 1.48; use vars qw($VERSION); diff --git a/lib/Math/Trig.pm b/lib/Math/Trig.pm index d8ecf69be4..76feca7d2e 100644 --- a/lib/Math/Trig.pm +++ b/lib/Math/Trig.pm @@ -10,14 +10,14 @@ package Math::Trig; use 5.005; use strict; -use Math::Complex 1.47; +use Math::Complex 1.48; use Math::Complex qw(:trig :pi); use vars qw($VERSION $PACKAGE @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @ISA = qw(Exporter); -$VERSION = 1.12; +$VERSION = 1.13; my @angcnv = qw(rad2deg rad2grad deg2rad deg2grad diff --git a/lib/Math/Trig.t b/lib/Math/Trig.t index 7a88fe97a8..7b0d7cfe60 100755 --- a/lib/Math/Trig.t +++ b/lib/Math/Trig.t @@ -28,8 +28,8 @@ BEGIN { plan(tests => 153); -use Math::Trig 1.12; -use Math::Trig 1.12 qw(:pi Inf); +use Math::Trig 1.13; +use Math::Trig 1.13 qw(:pi Inf); my $pip2 = pi / 2; @@ -311,10 +311,11 @@ print "# Infinity\n"; my $BigDouble = 1e40; -local $SIG{FPE} = { }; # E.g. netbsd-alpha core dumps on Inf arith +# E.g. netbsd-alpha core dumps on Inf arith without this. +local $SIG{FPE} = { }; ok(Inf() > $BigDouble); # This passes in netbsd-alpha. -ok(Inf() + $BigDouble > $BigDouble); # This coredumps. +ok(Inf() + $BigDouble > $BigDouble); # This coredumps in netbsd-alpha. ok(Inf() + $BigDouble == Inf()); ok(Inf() - $BigDouble > $BigDouble); ok(Inf() - $BigDouble == Inf()); |