123.4+2=125.40000000000001

piet at cs.uu.nl piet at cs.uu.nl
Wed Jun 21 09:12:51 EDT 2000


>>>>> Kalle Svensson <karl-sve at dsv.su.se> (KS) writes:

KS> On Wed, 21 Jun 2000, Peter Koppatz wrote:

>> On my calculator: 123.4+2 = 125.4 !?

KS> In fact, this probably isn't true. It's just that your calculator rounds
KS> the answer before handing it to you, just like print. Maybe. I should
KS> probably change my name to Search Deja... :)

I think calculators use decimal representation internally, so they don't
get this kind of error. Of course this introduces errors in other cases.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl



More information about the Python-list mailing list