Always false float comparisons

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Mon May 16 01:52:16 PDT 2016


On Monday, 16 May 2016 at 08:47:03 UTC, Iain Buclaw wrote:
> But you *didn't* request coercion to 32 bit floats.  Otherwise 
> you would have used 1.30f.

	const float f = 1.3f;
	float c = f;
	assert(c*1.0 == f*1.0); // Fails! SHUTDOWN!




More information about the Digitalmars-d mailing list