Always false float comparisons

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Sun May 15 11:59:51 PDT 2016


On Sunday, 15 May 2016 at 18:41:57 UTC, Adam D. Ruppe wrote:
> I suppose people figure if they use the same compiler, same 
> build options, same source code and feed the same data into it, 
> they expect to get the *same* results. It is a deterministic 
> machine, right?

In this case it is worse, you get this:

float f = some_pure_function();
const float cf = some_pure_function();

assert(cf==f); // SHUTDOWN!!!

But Walter doesn't think this is an issue, because correctness is 
just a high school feature.


More information about the Digitalmars-d mailing list