[Rd] Standalone Mathlib, C++ and ISNAN()

Thomas Lumley tlumley at u.washington.edu
Sat Jan 8 23:11:57 CET 2005

A review:

The C++ math header undefines isnan, so if isnan is a macro, ISNAN() will 
not work in C++ code.

C99 specifies that isnan is a macro, but in C90 compilers, where it is an 
extension, isnan is often a function (explaining why the issue didn't come 
up earlier). For example, isnan is a macro on my Mac laptop but a function 
on my Linux desktop.

R-devel now defines ISNAN to call a function if used in C++ code. It still 
calls isnan in C code.


Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

More information about the R-devel mailing list