summaryrefslogtreecommitdiff
path: root/lib/Math/Complex.pm
diff options
context:
space:
mode:
authorJarkko Hietaniemi <Jarkko.Hietaniemi@cc.hut.fi>1997-04-23 00:00:00 +0000
committerChip Salzenberg <chip@atlantic.net>1997-04-23 00:00:00 +1200
commitf48376444e1405b4e0150983bc80ff0f594aefce (patch)
tree9fbcbd38f45ff874f0b8d68c3e144d00959ab25f /lib/Math/Complex.pm
parent10dd38fc8440f4e4fcf5c186239fc21ecb05d6cb (diff)
downloadperl-f48376444e1405b4e0150983bc80ff0f594aefce.tar.gz
Math::Complex update
Diffstat (limited to 'lib/Math/Complex.pm')
-rw-r--r--lib/Math/Complex.pm14
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