From: Nicholas Clark Date: Sun, 3 Feb 2008 13:10:39 +0000 (+0000) Subject: Upgrade to Math::Complex 1.48 and Math::Trig 1.13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b57c8994d18dca212b1e1f9547c24fffd7deff90;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Math::Complex 1.48 and Math::Trig 1.13 p4raw-id: //depot/perl@33222 --- diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm index 36dc1ea..819a63d 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 cbd5ed3..c914331 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 d8ecf69..76feca7 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 7a88fe9..7b0d7cf 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());