Roots of unity: Difference between revisions
m
→{{header|Wren}}: Minor update following changes to complex number formatting.
Thundergnat (talk | contribs) 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(" $
}</syntaxhighlight>
Line 2,144:
<pre>
2 roots of 1:
1.00000000000000 +
-1.00000000000000 +
3 roots of 1:
1.00000000000000 +
-0.50000000000000 +
-0.50000000000000 -
4 roots of 1:
1.00000000000000 +
0.00000000000000 +
-1.00000000000000 +
-0.00000000000000 -
5 roots of 1:
1.00000000000000 +
0.30901699437495 +
-0.80901699437495 +
-0.80901699437495 -
0.30901699437495 -
</pre>
|