floats default to NaN... why?

Andrej Mitrovic andrej.mitrovich at gmail.com
Sat Apr 14 11:02:48 PDT 2012


On 4/14/12, F i L <witte2008 at gmail.com> wrote:
>      auto f = 1.0f; // is float not Float

UFCS in 2.059 to the rescue:

struct Float
{
    float payload = 0.0;
    alias payload this;
}

@property Float f(float val) { return Float(val); }

void main()
{
    auto f = 1.0.f;
}


More information about the Digitalmars-d-learn mailing list