Re: NaN/Inf fix for ECPG
Rémi Zara <remi_zara@mac.com>
From: Rémi Zara <remi_zara@mac.com>
To: Boszormenyi Zoltan <zb@cybertec.at>
Cc: Michael Meskes <meskes@postgresql.org>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-02-24T19:45:12Z
Lists: pgsql-hackers
Le 24 févr. 2010 à 18:58, Boszormenyi Zoltan a écrit : > > Here's the attached test code. Compile it with > > gcc -Wall -o nantest nantest.c -lm > > and run it. It tests NAN anf INFINITY values with isinf() and isnan(). > The expected output is: > > ================== > $ ./nantest > computed NAN > 1 0 > computed INFINITY > 0 1 > ================== > > Instead of "computed", NetBSD/x86-64 prints "defined" > but the test results are the same as under Linux/x86-64. > Here it is : -bash-4.1$ gcc -Wall -o nantest nantest.c -lm -bash-4.1$ ./nantest defined NAN 0 1 defined INFINITY 0 1 Ok. So, on NetBSD/mips (#ifdef __NetBSD__ && __mips__), isnan(NAN) is true, isnan((double)NAN) is false, and isnan((double)(0.0 / 0.0)) is true. Regards, Rémi Zara