Originally created by: M.Schaber
(This is a rephrased example of a case which arrived via email.)
Python has the range() and xrange() constructs to iterate over integers. However, there is no such construct for floats.
What Every Computer Scientist Should Know About Floating-Point Arithmetic by David Goldberg.
You should also be aware that the FPU on the runtime might handle the precision and rounding different than the Python code on the developer PC, if you're about to compare floating point values between PC and runtime e. G. via monitoring.
Recipe 66472 in the Python Cookbook, or in the Discussion on Stack Overflow.
Log in to post a comment.