checking whether the number is NaN

2012-12-28 Thread Zhenya
Hi! Tell me please,are there any way to check whether number is NaN?

Re: checking whether the number is NaN

2012-12-28 Thread Zhenya
On Friday, 28 December 2012 at 15:59:35 UTC, bearophile wrote: Zhenya: Tell me please,are there any way to check whether number is NaN? http://dlang.org/phobos/std_math.html#isNaN Bye, bearophile Thank you!

Re: checking whether the number is NaN

2012-12-28 Thread Red
Tell me please,are there any way to check whether number is NaN? http://dlang.org/phobos/std_math.html#isNaN pure nothrow @trusted bool isNaN(real x); Returns !=0 if e is a NaN. --- Seems like a slight documentation disagreement. Shows bool prototype but description

Re: checking whether the number is NaN

2012-12-28 Thread Simen Kjaeraas
On 2012-42-28 16:12, Zhenya zh...@list.ru wrote: Hi! Tell me please,are there any way to check whether number is NaN? us std.math.isNaN. But if you really don't want to: float x = ...; if (x != x) { writeln( x is NaN ); } I'm unsure how aggressive the optimizer is allowed to be in