Float compare broke!

Era Scarecrow rtcvb32 at yahoo.com
Mon Jun 11 03:33:20 PDT 2012


  Most curiously while making unittests the asserts fail when I've 
confirmed it's working. The difference seems to be if it's 
immutable/const vs non, and why this makes a difference I don't 
see... Can someone give some light to this?

const float i_f = 3.14159265;
float a = i_f;
float b = i_f;
assert(a==b);    //passes
assert(a==i_f);  //fails


More information about the Digitalmars-d-learn mailing list