From: Jarkko Hietaniemi Date: Wed, 3 May 2000 17:57:16 +0000 (+0000) Subject: The search of infinity continues, this time simplified. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=806e78a957fcce8bc56cb2c211ffcbba23772d4c;p=p5sagit%2Fp5-mst-13.2.git The search of infinity continues, this time simplified. p4raw-id: //depot/cfgperl@6056 --- diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm index daf190e..82872b7 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. }