From tlumley at u.washington.edu  Sat Jan  8 23:11:57 2005
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Sat Jan  8 23:12:08 2005
Subject: [Rd] Standalone Mathlib, C++ and ISNAN()
In-Reply-To: <E87B67C7-5FC7-11D9-97FA-000393D3D676@unsw.edu.au>
References: <77B2A8C4-5ED8-11D9-97FA-000393D3D676@unsw.edu.au>
	<Pine.A41.4.61b.0501050759060.100170@homer05.u.washington.edu>
	<C2214FA4-5F4F-11D9-97FA-000393D3D676@unsw.edu.au>
	<Pine.A41.4.61b.0501051149490.59084@homer03.u.washington.edu>
	<DB4A6959-5F60-11D9-97FA-000393D3D676@unsw.edu.au>
	<Pine.A41.4.61b.0501051405010.59084@homer03.u.washington.edu>
	<82D986EA-5F6F-11D9-97FA-000393D3D676@unsw.edu.au>
	<16860.48925.390153.388499@devzero.bogus.domain>
	<E87B67C7-5FC7-11D9-97FA-000393D3D676@unsw.edu.au>
Message-ID: <Pine.A41.4.61b.0501081406410.219908@homer04.u.washington.edu>


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

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


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