This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author DhaReaL
Recipients DhaReaL, mark.dickinson
Date 2010-01-14.22:04:44
SpamBayes Score 1.5784142e-09
Marked as misclassified No
Message-id <1a6f7efa1001141404v546ac7d5q829a49764c089f6c@mail.gmail.com>
In-reply-to <1263502467.65.0.981616625728.issue7704@psf.upfronthosting.co.za>
Content
kk, then i cannot use this comparison?, and this not happen
with....8.6-8>0.6 this is false, according to python.

2010/1/14 Mark Dickinson <report@bugs.python.org>

>
> Mark Dickinson <dickinsm@gmail.com> added the comment:
>
> This is not a bug:  Python, like many other computer languages, stores
> floats in binary.  The values 1.6 and 0.6 aren't exactly representable in
> the internal format used, so the stored versions of 1.6 and 0.6 are actually
> just very close approximations to those values.  It just so happens that the
> approximation for 1.6 is a tiny amount larger than 1.6 (the exact value
> stored is 1.600000000000000088817841970012523233890533447265625), while the
> approximation for 0.6 is a tiny amount smaller than 0.6 (the exact value is
> 0.59999999999999997779553950749686919152736663818359375).
>
> I recommend looking at the appendix to the Python tutorial for more
> information about floating point:
>
> http://docs.python.org/tutorial/floatingpoint.html
>
> ----------
> nosy: +mark.dickinson
> resolution:  -> invalid
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue7704>
> _______________________________________
>
Files
File name Uploaded
unnamed DhaReaL, 2010-01-14.22:04:44
History
Date User Action Args
2010-01-14 22:04:46DhaReaLsetrecipients: + DhaReaL, mark.dickinson
2010-01-14 22:04:45DhaReaLlinkissue7704 messages
2010-01-14 22:04:45DhaReaLcreate