On Oct 1, 2009, at 4:15 PM, Moritz Lenz wrote:
-Returns a list of all C<$n>th (complex) roots of C<$x>
+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>
Shouldn't this be "C<< $n < 0 >>"?
What's the 0th root of a number, then?
It would be a number $y for which $y ** 0 == $x, which can only be
fulfilled for $x == 1. So in the general cases the answer to the
question root($x, 0) is nonsense, which is best mapped to NaN.
But the very next part of the sentence reads "[returns] itself if C<$n
== 0>". If root($x, 0) is supposed to return a list containing both
NaN and $x, the specification should probably be explicit. If it's
meant to only return NaN, the "itself if C<$n == 0>" part needs to be
deleted.
-- Minimiscience