Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2001-09-12 15:06:11


----- Original Message -----
From: Paul A. Bristow <boost_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, September 12, 2001 4:43 PM
Subject: RE: [boost] Re: Math Functions

> Fine by me - but that is a detail that needs deciding/documenting
> about future boost math functions.
>
> I am still not clear how best to provide a PORTABLE NaN test. Ideas
> please!!
>
> if (x != x) test doesn't work for me on MSVC, but they do provide _isnan.
> so a macro test could switch, but what do other platforms do?
>
> if (x != x) test doesn't feel nice to me.
>
> Should NaN testing be the subject of a separate BOOST /Standard work?
> (It SHOULD be very widely used? But isn't because it doesn't work well?)
>
I've just started to read this whole thread from the begining so I will give
my opinion about this out of context.

I think this should be resolved in a separate numeric layer that should use
compiler and platform switches in config to take care of implementation
details.

Something along the line:

boost\numeric\numbers.hpp
~~~~~~~~~~~~~~~~~

namespace boost {
  namespace numeric {

   // Use compiler and platform specifics switches to implement this.
    template<class T> bool is_nan ( T const& ) ;

    template<class T> bool is_inf ( T const& ) ;

  }
}

other general number handling functions, traits, etc.. could be added here.

I can provide an initial interface in this layer, taken from my own stuff.

This is off the top of my head, and as I said, I'm out of context right now,
so forgive me if this has already been discussed, in which case I will get
to it eventually.

Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk