diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-05-02 00:36:46 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-05-02 00:36:46 +0000 |
commit | 5240e57461d2250452128643181252f0618b2549 (patch) | |
tree | d731781fc0a3eebc6db2942332927d5a9d0e9c7b /lib | |
parent | a1757be16722fb4efed43c4f1cab6f947ea4d86f (diff) | |
download | perl-5240e57461d2250452128643181252f0618b2549.tar.gz |
Infinite problems.
p4raw-id: //depot/cfgperl@6039
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Math/Complex.pm | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm index 4439e56f17..b13191bf38 100644 --- a/lib/Math/Complex.pm +++ b/lib/Math/Complex.pm @@ -19,9 +19,9 @@ BEGIN { 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); + undef $Inf unless $Inf =~ /^inf(?:inity)?$/i; # Inf INF inf Infinity + $Inf = "Inf" if !defined $Inf || !($Inf > 0); # Desperation. } use strict; @@ -998,8 +998,6 @@ sub cosh { return $ex ? ($ex + 1/$ex)/2 : $Inf; } my ($x, $y) = @{$z->cartesian}; - my $cy = CORE::cos($y); - my $sy = CORE::cos($y); $ex = CORE::exp($x); my $ex_1 = $ex ? 1 / $ex : $Inf; return (ref $z)->make(CORE::cos($y) * ($ex + $ex_1)/2, @@ -1024,8 +1022,8 @@ sub sinh { my $sy = CORE::sin($y); $ex = CORE::exp($x); my $ex_1 = $ex ? 1 / $ex : $Inf; - return (ref $z)->make($cy * ($ex - $ex_1)/2, - $sy * ($ex + $ex_1)/2); + return (ref $z)->make(CORE::cos($y) * ($ex - $ex_1)/2, + CORE::sin($y) * ($ex + $ex_1)/2); } # |