String to Float, without introducing errors

Chris Angelico rosuav at gmail.com
Sat Dec 17 17:58:05 EST 2022


On Sun, 18 Dec 2022 at 09:46, Stefan Ram <ram at zedat.fu-berlin.de> wrote:
>
> Grant Edwards <grant.b.edwards at gmail.com> writes:
> >Yes, fixed point (or decimal) is a better fit for what he's doing. but
> >I suspect that floating point would be a better fit for the problem
> >he's trying to solve.
>
>   I'd like to predict that within the next ten posts in this
>   thread someone will mention "What Every Computer Scientist
>   Should Know About Floating-Point Arithmetic".
>
> |>>> 0.1 + 0.2 - 0.3
> |5.551115123125783e-17
>

Looks like someone just did.

ChrisA


More information about the Python-list mailing list