From jwe at bevo.che.wisc.edu  Thu Jan  6 05:31:25 2005
From: jwe at bevo.che.wisc.edu (John W. Eaton)
Date: Thu Jan  6 05:32:29 2005
Subject: [Rd] Standalone Mathlib, C++ and ISNAN()
In-Reply-To: <82D986EA-5F6F-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>
Message-ID: <16860.48925.390153.388499@devzero.bogus.domain>

On  6-Jan-2005, Bill Northcott <w.northcott@unsw.edu.au> 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 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.
| 
| I asked the same question.  So far I got no response.

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 easier to call from C
than directly from C++.

jwe

-- 
www.octave.org | www.che.wisc.edu/~jwe | Peace would shock and awe me.


[Rd] Standalone Mathlib, C++ and ISNAN()
John W. Eaton