Float** internal representation (Numeric module)

Alexander Sourjikov spb526 at rol.ru
Wed Oct 22 03:38:27 EDT 2003


Hi pals,
i am using python for numerical simulations and noticed that
when i assign a Float variable say 0.1 python sees it like
0.10000000149011612.
I have also checked if python really takes these digits into account and
it turned out to be truth, because variable * 2 gives
0.20000000298023224
Does anyone have an idea where these weird digits come from and
how to avoid this strange effect ?

Would be very grateful for any help

--
Alex Sourjikov






More information about the Python-list mailing list