On Thursday, 2 March 2017 at 20:30:47 UTC, Guillaume Chatelet wrote:
Here is the same code in D:
void main(string[] args)
{
    import std.math;
    FloatingPointControl fpctrl;
    fpctrl.rounding = FloatingPointControl.roundUp;
    writefln("%.32g", float.min_normal + 1.0f);
}

Execution on my machine yields:
dmd -run test_denormal.d
1

Did I miss something?

This example is closer to the C++ one:

void main(string[] args)
{
    import core.stdc.fenv;
    fesetround(FE_UPWARD);
    writefln("%.32g", float.min_normal + 1.0f);
}

It still yields "1"

Reply via email to