From: Jarkko Hietaniemi Date: Fri, 28 Apr 2000 13:14:04 +0000 (+0000) Subject: Preserve $!. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3a188f30750b7b6044dc11da3853f0d540738f37;p=p5sagit%2Fp5-mst-13.2.git Preserve $!. p4raw-id: //depot/cfgperl@5997 --- diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm index 3fffcde..3c4894a 100644 --- a/lib/Math/Complex.pm +++ b/lib/Math/Complex.pm @@ -73,8 +73,12 @@ my %DISPLAY_FORMAT = ('style' => 'cartesian', my $eps = 1e-14; # Epsilon my $Inf; -unless ($^O eq 'unicos') { # Unicos gets a fatal runtime error +# Unicos gets a fatal runtime error without -h matherr=errno in ccflags +unless ($^O eq 'unicos') { + my $e = $!; $Inf = CORE::exp(CORE::exp(30)); + $! = $e; # Clear ERANGE. + undef $Inf unless $Inf =~ /^inf$/; # Inf INF inf } $Inf = "Inf" if !defined $Inf || !$Inf > 0;