problem with isnan
Daniel Kozak via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Nov 10 23:08:15 PST 2016
Dne 10.11.2016 v 17:41 Charles Hixson via Digitalmars-d-learn napsal(a):
> The line:
>
> assert (isnan (c.curActivation), "cell has unexpected
> curActivation: %s".format(c.curActivation));
>
> throws the exception:
>
> core.exception.AssertError at cell.d(285): cell has unexpected
> curActivation: nan
>
> and I've looked at it backwards and forwards and don't understand
> why. It's *supposed* to be nan, and the assert message reports that
> it is, but it should pass the assert test, not throw an assertion.
> What am I doing wrong?
You need to use https://dlang.org/library/std/math/is_nan.html
More information about the Digitalmars-d-learn
mailing list