News for hackers. Stuff that matters.
Re:How to compare floats in Python by eru on Thursday March 31, 2022 @01:38AM (#30864161)
In spirit you are right.

Alas, floating point arithmetic is not necessarily deterministic in the sense that running the same Python or C code twice is guaranteed to give you the some results.

First, your compiler is often allowed to do weird things. (Like compile the same code in different ways.) And there's some weirdness with the state of flags that might be different from iteration to iteration.

See https://randomascii.wordpress.com/2013/07/16/floating-point-... for some more information.

There are no comments on this comment yet.