Browse files

[Complex] add polar; fix "returns" traits

  • Loading branch information...
1 parent f10aa0d commit e8502deb844a3c4c31a9f3548a975402f038fbee @moritz moritz committed Jul 10, 2012
Showing with 12 additions and 5 deletions.
  1. +12 −5 lib/Complex.pod
17 lib/Complex.pod
@@ -17,27 +17,34 @@ Adding a trailing C<i> to a number literal makes it a Complex, for example
=head2 new
- proto method new(*@, *%) {*}
- multi method new(Real $re, Real $im)
+ proto method new(*@, *%) {*} returns Complex:D
+ multi method new(Real $re, Real $im) returns Complex:D
Creates a new C<Complex> object from a the real and imaginary part.
=head2 re
- method re(Complex:D:) return Real:D
+ method re(Complex:D:) returns Real:D
Returns the real part of the complex number
=head2 im
- method im(Complex:D:) return Real:D
+ method im(Complex:D:) returns Real:D
Returns the imaginary part of the complex number
=head2 isNaN
- method isNaN(Complex:D:) return Bool:D
+ method isNaN(Complex:D:) returns Bool:D
Returns true if the real or imaginary part is C<NaN> (not a number)
+=head2 polar
+ method polar(Complex:D:) returns Positional:D
+Returns a two-element list of the polar coordinates for this value,
+ie magnitude and angle in radians.
=end pod

0 comments on commit e8502de

Please sign in to comment.