floating point conversion

Martin Krejcirik via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 1 05:38:31 PDT 2014


import std.conv;

void main()
{
    float a = 1.23f;
    double b = to!float("1.23");
    assert (a == b); // ???
}

Should the assert fail or not ? (Please reply without trying first).


If your reply is yes, should
assert (a == to!float("1.23"))
fail or not ?

I'm bringing this up, because dmd and gdc (x86) don't agree on this.

-- 
mk


More information about the Digitalmars-d-learn mailing list