Gabriel Dos Reis <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "jvd" <[EMAIL PROTECTED]> writes:
>
> | Dear boosters,
> |
> | seems like this code
> |
> |     template< typename T >
> |     bool is_nan( const T& v )
> |     {
> |         return std::numeric_limits<T>::has_quiet_NaN && (v != v);
> |     }
> |
> | does not work correctly on some machines.
>
> Yes.  It is an incorrect (unfortunately popular) implementation.
>
Right. We should say that more often. It is incorrect however popular.

Most compilers provide a non standard extension for this purpose.
For instance, Borland uses _isnan.
In general, these extensions are found on <float>.
The best approach, IMO, is to have a boost::is_nan() with compiler specific
implementations.

Fernando Cacciola




_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to