123.3 + 0.1 is 123.3999999999 ?

Simon Brunning SBrunning at trisystems.co.uk
Thu May 15 12:24:02 EDT 2003


> From:	A Puzzled User [SMTP:kendear_nospam at nospam.com]
> In Python 2.2.2
> 
>  >>> float("123.4")+0.1
> 123.5
> 
>  >>> float("123.3")+0.1
> 123.39999999999999
> 
>  >>> float("123.1") + 1
> 124.09999999999999
> 
> how come there are these inaccuracies?
 
<http://www.brunningonline.net/simon/blog/archives/000710.html>

Cheers,
Simon Brunning
TriSystems Ltd.
sbrunning at trisystems.co.uk
--LongSig




-----------------------------------------------------------------------
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorised. If you are not the intended recipient, any disclosure,
copying, distribution, or any action taken or omitted to be taken in
reliance on it, is prohibited and may be unlawful. TriSystems Ltd. cannot
accept liability for statements made which are clearly the senders own.





More information about the Python-list mailing list