NAN code

Поиск
Список
Период
Сортировка
Искать

NAN code

От:
Bruce Momjian <maillist@candle.pha.pa.us>
Дата:
I have found a way to assign NAN to a variable, thanks to the library
source code.  Is this better than the code I just posted?  Looks pretty
platform-specific, and we may be better with my earlier code to just use
num, which I have committed to the CURRENT tree.

The strange thing is that isnan(0/0) generates a floating-pointer error
and stops the program, but this does not.  Strange.

---------------------------------------------------------------------------#include #include main(){	double x;	x = 3;		if (isnan((x-x)/(x-x)))		printf("nan\n");	else		printf("not nan\n");}

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610) 853-3000 +  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

FAQ