How do I calculate $2^n$th roots of unity precisely?
I'm trying to get all the $2^n$th roots of unity in order, precisely and quickly. The obvious solution (calculating the roots as $\exp\left(\frac{2\pi ik}{2^n}\right)$) is too imprecise; floating point tells me that $\exp(i\pi)=-1+0.00000000000000012246467991473532i$. I know about the IEEE 754 recommended functions cosPi and sinPi, which would solve my problem, but they're not available on my system. I'd like a fast solution, so high precision math is out of the question.
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.