Roots of unity: Difference between revisions

m
→‎{{header|Wren}}: Minor update following changes to complex number formatting.
m (syntax highlighting fixup automation)
m (→‎{{header|Wren}}: Minor update following changes to complex number formatting.)
Line 2,138:
for (n in 2..5) {
Fmt.print("$d roots of 1:", n)
for (r in roots.call(n)) Fmt.print(" $170.14z", r)
}</syntaxhighlight>
 
Line 2,144:
<pre>
2 roots of 1:
1.00000000000000 + 0.00000000000000i
-1.00000000000000 + 0.00000000000000i
3 roots of 1:
1.00000000000000 + 0.00000000000000i
-0.50000000000000 + 0.86602540378444i
-0.50000000000000 - 0.86602540378444i
4 roots of 1:
1.00000000000000 + 0.00000000000000i
0.00000000000000 + 1.00000000000000i
-1.00000000000000 + 0.00000000000000i
-0.00000000000000 - 1.00000000000000i
5 roots of 1:
1.00000000000000 + 0.00000000000000i
0.30901699437495 + 0.95105651629515i
-0.80901699437495 + 0.58778525229247i
-0.80901699437495 - 0.58778525229247i
0.30901699437495 - 0.95105651629515i
</pre>
 
9,479

edits