Language change and code breaks

pfenn at pfenn at
Thu Jul 12 13:17:01 EDT 2001

         Tom> I *always* forget the 1/3 == 0 thing between programming
         Tom> OTOH, I also quickly remember after making the mistake the
         Tom> time.

     What is it that reminds you of the mistake?  Is it something glaring
     using the result of 1/3 as a divisor and getting a divide-by-zero
error, or
     is it something more subtle like getting slightly incorrect results
     having to dig through your code to find the problem?

     Skip Montanaro (skip at

It's usually easy to find using the primitive tests I set up.  Typically,
data starts out as floating point, so this behavior won't cause incorrect
results.  Instead, I get incorrect graph labeling, etc.   However, this
issue is going to keep coming up as a problem because it's not what an
occasional user, even an experienced occasional user expects to happen,
particularly with a dynamically typed language like Python.   This is the
only point on which I consider Visual Basics behavior to be "better" than

Is there really much code that depends on 1/3 == 0 being true?

Tom Fenn

More information about the Python-list mailing list