The above code snippet works correctly when I use LDC compiler (it finds expected 'f' value and prints it to console). I'm wondering is it a bug in DMD?

p.s. the final code used by both compilers:

import std.stdio;
import std.conv;

int main(string[] argv)
{
    const float eps = 1.0f;
    float f = 0.0f;
    while (f + eps != f)
        f += 1.0f;

    writeln("eps = ", eps, ", max_f = ", f);
    return 0;
}


Reply via email to