[Tutor] Hoping for a brief explanation!
Joel Goldstick
joel.goldstick at gmail.com
Tue Aug 16 07:59:39 EDT 2022
On Tue, Aug 16, 2022 at 7:52 AM C S <sasalito at gmail.com> wrote:
>
> Thank you!
>
> >>> print(10>9.999999999999999)
> True
> >>> print(10>9.9999999999999999)
> False
You should read about how floating point arithmetic works.
Here is some food for thought
>>> print(10-9.9999999999999999)
0.0
>>> print(10-9.999999999999999)
1.7763568394002505e-15
>>>
>>> print(9.9999999999999999)
10.0
>>> print(9.999999999999999)
9.999999999999998
>>>
> Python on windows 3.10 64bit.
>
> Sincerely,
>
> Thanks!
>
> --
> Cesar Salas
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
--
Joel Goldstick
More information about the Tutor
mailing list