[Issue 7455] Allow a cast to discard precision from a floating point during constant folding

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 12 18:50:15 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7455



--- Comment #3 from dawg at dawgfoto.de 2012-02-12 18:50:14 PST ---
static import std.conv;

int main()
{
    real a = 1.0L + float.epsilon;
    if (std.conv.to!float(a + 1.0L) > 2.0L)
        return 1;
    return 0;
}

------

If I try the library version it's result will differ with '-O -inline'.
Yeah I know, results may vary depending on compiler flags.
So I've no reliable way to round to a single precision float?
Does anybody have a good idea how to solve Bug 6531 then?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list