Count Down to Zero

Christopher Browne cbbrowne at news.hex.net
Sat Sep 23 00:46:21 EDT 2000


In our last episode (Fri, 22 Sep 2000 13:27:46 -0700),
the artist formerly known as Curtis Jensen said:
>How come Python can't count down to zero?  Was it written by ancient
>Romans or something?
>0.2
>0.1
>1.38777878078e-16
>>>> 
>
>The last one should be 0.0

What is 0.0 in floating point?

Subtracting 0.1 from 0.2 doesn't give you exactly 0.1, and cascading
differences mean that 0.0 != 0.0...
-- 
(concatenate 'string "cbbrowne" "@" "acm.org")
<http://www.hex.net/~cbbrowne/>
"The Commonlisp Manifesto:  Parenthesizers of the world unite!  You
have nothing to loose but your braces!"
-- Marco Antoniotti <marcoxa at cs.nyu.edu>



More information about the Python-list mailing list