Weird arithmetic in Python

Samuel A. Falvo II kc5tja at garnet.armored.net
Sun Oct 29 17:57:00 EST 2000


On Sun, 29 Oct 2000 22:39:17 GMT, yminsky at cs.cornell.edu wrote:
>>>> .1 * 3 - .3
>5.55111512313e-17

Round-off error.  The computer is incapable of representing certain numbers
with full fidelity.  Evaluating 0.1*3 loses some precision over just typing
in 0.3, so the difference in precision is the result you see above
(5.55111512313e-17).

-- 
KC5TJA/6, DM13, QRP-L #1447 | Official Channel Saint, *Team Amiga*
Samuel A. Falvo II	    |
Oceanside, CA		    |



More information about the Python-list mailing list