Mapping a BigInteger to a circle
- by Martin
I have a C# system using 160 bit numbers, stored in a BigInteger. I want to display these things on a circle, which means mapping the 0-2^160 range into the 0-2Pi range. How would I do this?
The approach that jumps instantly to mind is
angle = (number / pow(2, 160)) * TwoPi;
However, that has complexities because the division will truncate the result into an integer.