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

From: Thomas Lumley <tlumley_at_u.washington.edu>
Date: Thu 06 Jan 2005 - 06:53:29 EST

On Thu, 6 Jan 2005, Bill Northcott wrote:

> As I explained in the last message:

>>> In R2.0 ISNAN() is defined using isnan thus (isnan(x)!=0). isnan() is in
>>> math.h and this works perfectly for C code. However, in C++ the header
>>> cmath (included by iostream and others) undefs isnan(). So on platforms
>>> for which isnan() is a macro, the code breaks at compile time with
>>> 'isnan() undeclared'.

I believe (with a little Googling) the suggested C++ approach is to use std::isnan if <cmath> is included.

         -thomas

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

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Jan 06 06:52:35 2005

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:02:29 EST