diff options
author | Jarkko Hietaniemi <Jarkko.Hietaniemi@cc.hut.fi> | 1997-04-23 00:00:00 +0000 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-04-23 00:00:00 +1200 |
commit | f48376444e1405b4e0150983bc80ff0f594aefce (patch) | |
tree | 9fbcbd38f45ff874f0b8d68c3e144d00959ab25f /lib/Math/Complex.pm | |
parent | 10dd38fc8440f4e4fcf5c186239fc21ecb05d6cb (diff) | |
download | perl-f48376444e1405b4e0150983bc80ff0f594aefce.tar.gz |
Math::Complex update
Diffstat (limited to 'lib/Math/Complex.pm')
-rw-r--r-- | lib/Math/Complex.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm index a501b99ddd..92504ed111 100644 --- a/lib/Math/Complex.pm +++ b/lib/Math/Complex.pm @@ -741,7 +741,7 @@ sub cosh { my ($x, $y) = @{$z->cartesian}; my $ex = exp($x); my $ex_1 = 1 / $ex; - return ($ex + $ex_1)/2 if $real; + return cplx(0.5 * ($ex + $ex_1), 0) if $real; return (ref $z)->make(cos($y) * ($ex + $ex_1)/2, sin($y) * ($ex - $ex_1)/2); } @@ -761,7 +761,7 @@ sub sinh { my ($x, $y) = @{$z->cartesian}; my $ex = exp($x); my $ex_1 = 1 / $ex; - return ($ex - $ex_1)/2 if $real; + return cplx(0.5 * ($ex - $ex_1), 0) if $real; return (ref $z)->make(cos($y) * ($ex - $ex_1)/2, sin($y) * ($ex + $ex_1)/2); } @@ -1326,11 +1326,11 @@ The I<k>th root for C<z = [r,t]> is given by: (root(z, n))[k] = r**(1/n) * exp(i * (t + 2*k*pi)/n) -The I<spaceship> comparison operator is also defined. In order to -ensure its restriction to real numbers is conform to what you would -expect, the comparison is run on the real part of the complex number -first, and imaginary parts are compared only when the real parts -match. +The I<spaceship> comparison operator, E<lt>=E<gt>, is also defined. In +order to ensure its restriction to real numbers is conform to what you +would expect, the comparison is run on the real part of the complex +number first, and imaginary parts are compared only when the real +parts match. =head1 CREATION |