summaryrefslogtreecommitdiff
path: root/lib/Math
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-04-28 13:14:04 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-04-28 13:14:04 +0000
commit3a188f30750b7b6044dc11da3853f0d540738f37 (patch)
treea787844c0ef405552ee1844a68ecb2ab5c9e0014 /lib/Math
parenta216278e445bcb0a1a5a932d064bb4fc497fec9a (diff)
downloadperl-3a188f30750b7b6044dc11da3853f0d540738f37.tar.gz
Preserve $!.
p4raw-id: //depot/cfgperl@5997
Diffstat (limited to 'lib/Math')
-rw-r--r--lib/Math/Complex.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm
index 3fffcdef70..3c4894ad8e 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;