fixed point vs fixed decimal
Terry Hancock
hancock at anansispaceworks.com
Tue Jan 7 20:41:35 EST 2003
John Roth wrote:
> You're right! I'd forgotten about the applications in graphics and
> motor control where floats are too expensive.
They are also a convenient natural representation for angles -- if you
allow a fixed size, unsigned integer to overflow without error, and map the
range of the integer to a full circle, then its behavior is exactly correct
for the task and does not require special edge-case handling.
I saw this trick in a graphics programming book years ago.
They can also be handy in graphics acceleration tasks (but in C, obviously).
--
Anansi Spaceworks
http://www.anansispaceworks.com
More information about the Python-list
mailing list