delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/03/18/10:54:26

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019