| delorie.com/archives/browse.cgi | search |
| Date: | 18 Mar 2003 15:54:21 -0000 |
| Message-ID: | <20030318155421.8252.qmail@tyr.diku.dk> |
| From: | Morten Welinder <terra AT diku DOT dk> |
| To: | rudd AT cyberoptics DOT com |
| cc: | djgpp-workers AT delorie DOT com |
| Subject: | isnan |
| Reply-To: | djgpp-workers AT delorie DOT com |
You use the fact that sizeof (float) != sizeof (double).
#define isnan(x) (sizeof (x) == sizeof (float)
? isnanf (x)
: isnand (x))
-- possibly extended to handle long double also. (And note that even
thought "x" occurs three times, it will be evaluated exactly once.)
FYI, Solaris just uses a function is double arg.
Morten
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |