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
On 06/01/2005, at 3:31 PM, John W. Eaton wrote:
What I finally decided to do for Octave was to use a C language
autoconf test for isnan, then provide a function declared extern C
that is a wrapper around the C isnan function (if it exists). I also
use this method for other functions that may be
On Thu, 2005-01-06 at 08:29 +1100, Bill Northcott wrote:
On 06/01/2005, at 6:53 AM, Thomas Lumley wrote:
I believe (with a little Googling) the suggested C++ approach is to
use std::isnan if cmath is included.
I tried that too, but without any success. I even tried
__gnu_cxx::isnan.
On Wed, 5 Jan 2005, Bill Northcott wrote:
If building against a full R library, one might possible use R_IsNaN instead
but this function is not included in libRmath v2.0 and the function
R_IsNaNorNA which was used in libRmath v1.9 no longer exists
Yes, but in your standalone C or C++ code you
On 06/01/2005, at 3:09 AM, Thomas Lumley wrote:
If building against a full R library, one might possible use R_IsNaN
instead but this function is not included in libRmath v2.0 and the
function R_IsNaNorNA which was used in libRmath v1.9 no longer exists
Yes, but in your standalone C or C++ code
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
On Thu, 6 Jan 2005, Bill Northcott wrote:
On 06/01/2005, at 6:53 AM, Thomas Lumley wrote:
I believe (with a little Googling) the suggested C++ approach is to use
std::isnan if cmath is included.
I tried that too, but without any success. I even tried __gnu_cxx::isnan.
It was suggested by one of
On 06/01/2005, at 9:12 AM, Thomas Lumley wrote:
It was suggested by one of the gcc people, but I could find no
documentation about it. The ISO C++ docs do not include isnan as a
symbol provided by cmath within the std namespace. I looked at the
gcc source code and could see no reason why it
On 6-Jan-2005, Bill Northcott [EMAIL PROTECTED] wrote:
| On 06/01/2005, at 9:12 AM, Thomas Lumley wrote:
| It was suggested by one of the gcc people, but I could find no
| documentation about it. The ISO C++ docs do not include isnan as a
| symbol provided by cmath within the std