News for hackers. Stuff that matters.
Re:NaNs Just Don't Get No Respect by roryokane on Saturday August 18, 2012 @01:15AM (#4400310)
An alternative workaround to writing `float f = 0` in languages without NaN:

    float f;
    bool thingIsFoo = condition1; // store the result…
    if (thingIsFoo)
        f = 7;
    // ... code ...
    if (thingIsFoo && condition2) // and explicitly depend on it later
        ++f;
But this causes an extra `&&` to be computed at runtime, so it seems NaNs are still better for this case.

There are no comments on this comment yet.