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

From: Thomas Lumley <tlumley_at_u.washington.edu>
Date: Thu 06 Jan 2005 - 09:12:30 EST

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 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 should work.

Hmm. What *are* C++ programmers supposed to use to test for NaN, then? It might well not be anything in the ISO standard, just as it isn't in C89, but surely there is some prescribed way to do it.

We don't want ISNAN to be a function unnecessarily in C, since it is used a lot and there is reportedly quite a bit of overhead to very simple functions on some processors.

         -thomas



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Jan 06 08:46:53 2005

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