Check floats for .nan

Nathan Reed nathaniel.reed at gmail.com
Sun Oct 7 15:34:34 PDT 2007


Janice Caron wrote:
> On 10/7/07, BCS <ao at pathlink.com> wrote:
>> If you want to test for nan use "testedValue !<>= 0"
> 
> Are we really sure about that?
> 
> If testedValue is complex (with non-zero real part) then it will not
> be less than 0, it will not be greater than zero, and it will not be
> equal to zero. But it will also not be NaN.

I believe you'd get a type error in that case (real and creal can't be 
directly compared, etc.)  Haven't tried it though.

Thanks,
Nathan Reed



More information about the Digitalmars-d mailing list