Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

start to document Complex

  • Loading branch information...
commit f10aa0ddeaa4117c1cc941d86a00960f9463ab79 1 parent fde229c
Moritz Lenz moritz authored
Showing with 43 additions and 0 deletions.
  1. +43 −0 lib/Complex.pod
43 lib/Complex.pod
View
@@ -0,0 +1,43 @@
+=begin pod
+
+=TITLE class Complex
+
+ class Complex is Cool does Numeric { ... }
+
+Represents a number in the complex plane.
+
+Complex objects are immutable.
+
+Adding a trailing C<i> to a number literal makes it a Complex, for example
+
+ 2i; # same as Complex.new(0, 2);
+ 1-2e3i; # same as Complex.new(1, -2e3);
+
+=head1 Methods
+
+=head2 new
+
+ proto method new(*@, *%) {*}
+ multi method new(Real $re, Real $im)
+
+Creates a new C<Complex> object from a the real and imaginary part.
+
+=head2 re
+
+ method re(Complex:D:) return Real:D
+
+Returns the real part of the complex number
+
+=head2 im
+
+ method im(Complex:D:) return Real:D
+
+Returns the imaginary part of the complex number
+
+=head2 isNaN
+
+ method isNaN(Complex:D:) return Bool:D
+
+Returns true if the real or imaginary part is C<NaN> (not a number)
+
+=end pod
Please sign in to comment.
Something went wrong with that request. Please try again.