From: Steve Peters Date: Mon, 11 Feb 2008 17:37:43 +0000 (+0000) Subject: Upgrade to Math-Complex-1.51 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8b4fe3688e6d5b49d9f42d88f11edd1138166278;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Math-Complex-1.51 p4raw-id: //depot/perl@33282 --- diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm index 2258f08..73670f1 100644 --- a/lib/Math/Complex.pm +++ b/lib/Math/Complex.pm @@ -9,27 +9,37 @@ package Math::Complex; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $Inf); -$VERSION = 1.49; +$VERSION = 1.51; + +use Config; BEGIN { - # For 64-bit doubles, anyway. - my $IEEE_DBL_MAX = eval "1.7976931348623157e+308"; - my $BIGGER_THAN_THIS = 1e99; # Must find something bigger than this. + my %DBL_MAX = + ( + 4 => '1.70141183460469229e+38', + 8 => '1.7976931348623157e+308', + 10 => '1.1897314953572317650857593266280070162E+4932', + 12 => '1.1897314953572317650857593266280070162E+4932', # AFAICT. + ); + my $nvsize = $Config{nvsize} || ($Config{uselongdouble} && $Config{longdblsize}) || $Config{doublesize}; + die "Math::Complex: Could not figure out nvsize\n" unless defined $nvsize; + my $DBL_MAX = eval $DBL_MAX{$nvsize}; + die "Math::Complex: Could not figure out max nv\n" unless defined $DBL_MAX; + my $BIGGER_THAN_THIS = 1e30; # Must find something bigger than this. if ($^O eq 'unicosmk') { - $Inf = $IEEE_DBL_MAX; + $Inf = $DBL_MAX; } else { local $!; - # We do want an arithmetic overflow, Inf INF inf Infinity:. + # We do want an arithmetic overflow, Inf INF inf Infinity. for my $t ( - 'exp(99999)', # even 9999 isn't big enough for long doubles - '9**9**9', + 'exp(99999)', # Enough even with 128-bit long doubles. 'inf', 'Inf', 'INF', 'infinity', 'Infinity', 'INFINITY', - '1e999', + '1e99999', ) { local $SIG{FPE} = { }; local $^W = 0; @@ -39,8 +49,9 @@ BEGIN { last; } } - $Inf = $IEEE_DBL_MAX unless defined $Inf; # Oh well, close enough. - die "Could not get Infinity" unless $Inf > $BIGGER_THAN_THIS; + $Inf = $DBL_MAX unless defined $Inf; # Oh well, close enough. + die "Math::Complex: Could not get Infinity" + unless $Inf > $BIGGER_THAN_THIS; } # print "# On this machine, Inf = '$Inf'\n"; } diff --git a/lib/Math/Complex.t b/lib/Math/Complex.t index 611a476..5f930e5 100755 --- a/lib/Math/Complex.t +++ b/lib/Math/Complex.t @@ -13,7 +13,7 @@ BEGIN { } } -use Math::Complex 1.49; +use Math::Complex 1.51; use vars qw($VERSION); diff --git a/lib/Math/Trig.pm b/lib/Math/Trig.pm index a8d94e2..159b1bd 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.49; +use Math::Complex 1.51; use Math::Complex qw(:trig :pi); use vars qw($VERSION $PACKAGE @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @ISA = qw(Exporter); -$VERSION = 1.14; +$VERSION = 1.15; my @angcnv = qw(rad2deg rad2grad deg2rad deg2grad diff --git a/lib/Math/Trig.t b/lib/Math/Trig.t index f5e6010..ed5661f 100755 --- a/lib/Math/Trig.t +++ b/lib/Math/Trig.t @@ -28,8 +28,8 @@ BEGIN { plan(tests => 153); -use Math::Trig 1.14; -use Math::Trig 1.14 qw(:pi Inf); +use Math::Trig 1.15; +use Math::Trig 1.15 qw(:pi Inf); my $pip2 = pi / 2;