November 11, 2016 Re: problem with isnan | ||||
---|---|---|---|---|
| ||||
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@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 |
Copyright © 1999-2021 by the D Language Foundation