Roots of unity: Difference between revisions

Line 1,631:
 
=={{header|Rust}}==
Here we demonstrate initialization from polar complex coordinate, radius 1, e^πi/n, and raising the resulting complex number to the power 2k for k in 0..n-1, which generates theapproximate roots (see the Mathematica answer for a nice display of exact vs approximate). This code will require adding the num crate to one's rust project, typically in Cargo.toml <i>[dependencies] \n num="0.2.0";</i>
<lang C>use num::Complex;
fn main() {
Anonymous user