math module broken?
Peter Otten
__peter__ at web.de
Sat Jul 24 15:27:54 EDT 2004
Roel Schroeven wrote:
> When the numbers get larger, floats start losing precision. If you
> restrict the numbers to the range [0, 360[ before conversion to radians
> (and hence to degrees), that problem doesn't exist.
>>> (360**100 +0.0) % 360
184.0
Rule of thumb: floats are always inaccurate. % may only help when you are
dealing with large integers denoting an angle in degrees - an unlikely
scenario methinks.
Peter
More information about the Python-list
mailing list