Roots of unity: Difference between revisions

m
→‎{{header|Raku}}: Add alternate
m (→‎{{header|Raku}}: Add alternate)
Line 2,154:
0.309016994374947-0.951056516295154i
0.809016994374947-0.587785252292473i</pre>
 
Alternately, you could use the built-in .roots method to find the nth roots of any number.
 
<syntaxhighlight lang="raku" line>.say for 1.roots(9)</syntaxhighlight>
{{out}}
<pre>1+0i
0.766044443118978+0.6427876096865393i
0.17364817766693041+0.984807753012208i
-0.4999999999999998+0.8660254037844387i
-0.9396926207859083+0.3420201433256689i
-0.9396926207859084-0.34202014332566866i
-0.5000000000000004-0.8660254037844384i
0.17364817766692997-0.9848077530122081i
0.7660444431189778-0.6427876096865396i</pre>
 
=={{header|REXX}}==
10,327

edits