Change 33512 by [EMAIL PROTECTED] on 2008/03/13 17:55:54
Integrate:
[ 33253]
Update to Math::Complex 1.49
[ 33268]
exp(999) isn't "infinity". Even exp(9999) can still be represented on
80 bit long doubles. exp(99999) can't.
[ 33282]
Upgrade to Math-Complex-1.51
[ 33286]
Teach Math::Complex the maximum NV for a 16 byte float. (At least, a
16 byte float on x86_64. This feels fragile.)
[ 33293]
Upgrade to Math-Complex-1.52
Affected files ...
... //depot/maint-5.10/perl/lib/Math/Complex.pm#4 integrate
... //depot/maint-5.10/perl/lib/Math/Complex.t#4 integrate
... //depot/maint-5.10/perl/lib/Math/Trig.pm#4 integrate
... //depot/maint-5.10/perl/lib/Math/Trig.t#4 integrate
Differences ...
==== //depot/maint-5.10/perl/lib/Math/Complex.pm#4 (text) ====
Index: perl/lib/Math/Complex.pm
--- perl/lib/Math/Complex.pm#3~33224~ 2008-02-03 05:37:22.000000000 -0800
+++ perl/lib/Math/Complex.pm 2008-03-13 10:55:54.000000000 -0700
@@ -9,39 +9,60 @@
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $Inf);
-$VERSION = 1.48;
+$VERSION = 1.52;
+
+use Config;
BEGIN {
- # For 64-bit doubles, anyway.
- my $IEEE_DBL_MAX = eval "1.7976931348623157e+308";
+ my %DBL_MAX =
+ (
+ 4 => '1.70141183460469229e+38',
+ 8 => '1.7976931348623157e+308',
+ # AFAICT the 10, 12, and 16-byte long doubles
+ # all have the same maximum.
+ 10 => '1.1897314953572317650857593266280070162E+4932',
+ 12 => '1.1897314953572317650857593266280070162E+4932',
+ 16 => '1.1897314953572317650857593266280070162E+4932',
+ );
+ my $nvsize = $Config{nvsize} ||
+ ($Config{uselongdouble} && $Config{longdblsize}) ||
+ $Config{doublesize};
+ die "Math::Complex: Could not figure out nvsize\n"
+ unless defined $nvsize;
+ die "Math::Complex: Cannot not figure out max nv (nvsize = $nvsize)\n"
+ unless defined $DBL_MAX{$nvsize};
+ my $DBL_MAX = eval $DBL_MAX{$nvsize};
+ die "Math::Complex: Could not figure out max nv (nvsize = $nvsize)\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(999)',
- '9**9**9',
- '1e999',
+ 'exp(99999)', # Enough even with 128-bit long doubles.
'inf',
'Inf',
'INF',
'infinity',
'Infinity',
'INFINITY',
+ '1e99999',
) {
local $SIG{FPE} = { };
local $^W = 0;
my $i = eval "$t+1.0";
- if ($i =~ /inf/i && $i > 1e+99) {
+ if (defined $i && $i > $BIGGER_THAN_THIS) {
$Inf = $i;
last;
}
}
- $Inf = $IEEE_DBL_MAX unless defined $Inf; # Oh well, close enough.
- die "Could not get Infinity" unless $Inf > 1e99;
+ $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";
+ # print "# On this machine, Inf = '$Inf'\n";
}
use strict;
==== //depot/maint-5.10/perl/lib/Math/Complex.t#4 (xtext) ====
Index: perl/lib/Math/Complex.t
--- perl/lib/Math/Complex.t#3~33224~ 2008-02-03 05:37:22.000000000 -0800
+++ perl/lib/Math/Complex.t 2008-03-13 10:55:54.000000000 -0700
@@ -13,7 +13,7 @@
}
}
-use Math::Complex 1.48;
+use Math::Complex 1.52;
use vars qw($VERSION);
==== //depot/maint-5.10/perl/lib/Math/Trig.pm#4 (text) ====
Index: perl/lib/Math/Trig.pm
--- perl/lib/Math/Trig.pm#3~33224~ 2008-02-03 05:37:22.000000000 -0800
+++ perl/lib/Math/Trig.pm 2008-03-13 10:55:54.000000000 -0700
@@ -10,14 +10,14 @@
use 5.005;
use strict;
-use Math::Complex 1.48;
+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.13;
+$VERSION = 1.16;
my @angcnv = qw(rad2deg rad2grad
deg2rad deg2grad
==== //depot/maint-5.10/perl/lib/Math/Trig.t#4 (xtext) ====
Index: perl/lib/Math/Trig.t
--- perl/lib/Math/Trig.t#3~33224~ 2008-02-03 05:37:22.000000000 -0800
+++ perl/lib/Math/Trig.t 2008-03-13 10:55:54.000000000 -0700
@@ -28,8 +28,8 @@
plan(tests => 153);
-use Math::Trig 1.13;
-use Math::Trig 1.13 qw(:pi Inf);
+use Math::Trig 1.16;
+use Math::Trig 1.16 qw(:pi Inf);
my $pip2 = pi / 2;
End of Patch.