note
asarih
All the replies posted so far finds a real root. Is there a method to find complex roots as well? [cpan://Math::Complex] doesn't seem to cut it.
<p>
<b>Update:</b> As pointed out below,
<code>c=r^(1/n)*e^(2*pi*i*j/n)</code> (for j=0,1,...,n-1) will do the trick, but I was thinking someone should have written an easy access to the roots, as in:
<code>
@roots=complex_roots($real, $n)
</code>
to give all the n-th roots of <code>$real</code>. Hmmm.... This shouldn't be too difficult. I'll leave it as exercise to the reader. :)
297695
297695