Author: colomon
Date: 2010-04-10 18:10:42 +0200 (Sat, 10 Apr 2010)
New Revision: 30357
Modified:
docs/Perl6/Spec/S32-setting-library/Numeric.pod
Log:
[Numeric] Move sqrt to Numeric. Remove incorrect return value type of roots.
Move cis and unpolar to Real. Add to-radians and from-radians to Numeric.
Modified: docs/Perl6/Spec/S32-setting-library/Numeric.pod
===================================================================
--- docs/Perl6/Spec/S32-setting-library/Numeric.pod 2010-04-10 15:46:49 UTC
(rev 30356)
+++ docs/Perl6/Spec/S32-setting-library/Numeric.pod 2010-04-10 16:10:42 UTC
(rev 30357)
@@ -19,8 +19,8 @@
Created: 19 Mar 2009 extracted from S29-functions.pod
- Last Modified: 15 Feb 2010
- Version: 5
+ Last Modified: 9 Apr 2010
+ Version: 6
The document is a draft.
@@ -123,27 +123,21 @@
desired multiplier. For picking a random integer you probably want
to use something like C<(1..6).pick> instead.
+=item sqrt
+
+ our Numeric multi method sqrt ( Numeric $x: ) is export
+
+Returns the principle square root of the parameter.
+
=item roots
- method roots (Numeric $x: Int $n --> List of Num) is export
+ method roots (Numeric $x: Int $n ) is export
Returns a list of all C<$n>th (complex) roots of C<$x>. Returns C<NaN> if
C<< $n <= 0 >>, itself if C<$n == 0>, and is free to return a single C<NaN>
if C<$x> is C<NaN> or C<Inf>, or in case of complex numbers if one of the
components is.
-=item cis
-
- our Complex multi method cis (Real $angle:) is export
-
-Returns 1.unpolar($angle)
-
-=item unpolar
-
- our Complex multi method unpolar (Real $mag: Real $angle) is export
-
-Returns a complex number specified in polar coordinates. Angle is in radians.
-
=item i
our Complex multi postfix:<i> ( Numeric $x )
@@ -155,6 +149,18 @@
$land\i
($land)i
+=item to-radians
+
+ our Numeric multi method to-radians ( Numeric $x: TrigBase $base ) is export
+
+Convert from C<$base> to radians.
+
+=item from-radians
+
+ our Numeric multi method from-radians ( Numeric $x: TrigBase $base ) is export
+
+Convert from radians to C<$base>.
+
=back
@@ -225,13 +231,19 @@
you I<must> call C<srand()> yourself if you wish to specify a deterministic
seed
(or if you wish to be differently nondeterministic).
-=item sqrt
+=item cis
- our Real multi method sqrt ( Real $x: ) is export
+ our Complex multi method cis (Real $angle:) is export
-Returns the square root of the parameter.
+Returns 1.unpolar($angle)
+=item unpolar
+ our Complex multi method unpolar (Real $mag: Real $angle) is export
+
+Returns a complex number specified in polar coordinates. Angle is in radians.
+
+
=back
=head2 Num