summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-05-03 17:57:16 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-05-03 17:57:16 +0000
commit806e78a957fcce8bc56cb2c211ffcbba23772d4c (patch)
tree8d59a170e371f80c317404fe14b4e6f4b83a1ed7
parent45ff97fd481b152e32f20b4632d328a4b033bbe2 (diff)
downloadperl-806e78a957fcce8bc56cb2c211ffcbba23772d4c.tar.gz
The search of infinity continues, this time simplified.
p4raw-id: //depot/cfgperl@6056
-rw-r--r--lib/Math/Complex.pm11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm
index daf190e89b..82872b7696 100644
--- a/lib/Math/Complex.pm
+++ b/lib/Math/Complex.pm
@@ -12,14 +12,9 @@ $VERSION = "1.30";
our($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $Inf);
BEGIN {
- eval { require POSIX; import POSIX 'HUGE_VAL' };
- if (exists &HUGE_VAL) {
- $Inf = sprintf "%g", &HUGE_VAL;
- } else {
- my $e = $!;
- $Inf = CORE::exp(CORE::exp(30));
- $! = $e; # Clear ERANGE.
- }
+ my $e = $!;
+ $Inf = CORE::exp(CORE::exp(30)); # We do want an arithmetic overflow.
+ $! = $e; # Clear ERANGE.
undef $Inf unless $Inf =~ /^inf(?:inity)?$/i; # Inf INF inf Infinity
$Inf = "Inf" if !defined $Inf || !($Inf > 0); # Desperation.
}