Jump to content

Roots of unity: Difference between revisions

added ocaml
No edit summary
(added ocaml)
Line 164:
}
}</java>
 
=={{header|OCaml}}==
<ocaml>open Complex
 
let pi = 4. *. atan 1.
 
let () =
for n = 1 to 10 do
Printf.printf "%2d " n;
for k = 1 to n do
let ret = polar 1. (2. *. pi *. float_of_int k /. float_of_int n) in
Printf.printf "(%f + %f i)" ret.re ret.im
done;
print_newline ()
done</ocaml>
 
=={{header|Perl}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.