float has too much precision

Faux Amis faux at amis.com
Tue Apr 21 19:47:26 UTC 2020

I'm dumbfounded, why does the following code write '35' on DMD32 D 
Compiler v2.091.0-dirty?

module magic;

float magic( float f )
     return f + 35f - f;

void main()
     import std.stdio;
     writeln( magic(1_000_000_000f) );

More information about the Digitalmars-d-learn mailing list