Roots of unity: Difference between revisions

m
no edit summary
mNo edit summary
Line 2,597:
Root 7: 0.17364817766693-0.984807753012208i
Root 8: 0.766044443118978-0.64278760968654i</pre>
 
=={{header|V (Vlang)}}==
{{trans|Ring}}
<syntaxhighlight lang="Zig">
import math
 
for n in 2..6 {
print("${n}: ")
for root in 0..n {
real := math.cos(2 * 3.14 * root/n)
imag := math.sin(2 * 3.14 * root/n)
print("${real:.4} ${imag:.4}i")
if root != n - 1 {print(", ")}
}
println("")
}
</syntaxhighlight>
 
=={{header|Wren}}==
291

edits