Q: (d = NAN) != NAN?

2016-04-08 Thread Ulrich Windl
Hello! Probably I'm doing something wrong, but I have some problems comparing a double with NAN: The value is NAN, but the test fails. Probably I should use isnana(). Here's my test case: --- #include #include int main() { double d = NAN; assert(d == NAN); return 0

Obscure iostream failure, a compiler bug or a language design issue?

2014-05-15 Thread Ulrich Windl
problem is that constructors are called sequentially without dependency analysis. So if d() is acaaled before including iostream (lexically), the program crashes. Reagrds, Ulrich Windl P.S. Usually I don't write such ugly code