Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2006-10-12 10:10:56

Johan Råde wrote:

> There are three problems:
> 1. The linking problem has been fixed in the latest version.
> (Or did you have the latest version and just forgot to compile
> long_double_mask.cpp?)

The latter.

> 2. A slightly different binary representation of long double than I had
> expected. Is there any preprocessor symbol that I can use to detect
> Alpha processors?

Stolen from numeric/interval/detail/alpha_rounding_control.hpp:

#if !defined(alpha) && !defined(__alpha__)
#error This header only works on Alpha CPUs.

This works on GCC and CXX.

> 3. Your <limits> header is a bit funny.
> numeric_limits<T>::quiet_NaN() returns a NaN with the signbit set.
> This triggered the assertion.
> (Does it matter? Maybe. According to C99, positive NaN should be
> written to text files as "nan" or "+nan" and negative NaN as "-nan".
> And this will probably be part of C++0x as well.)

Commenting out the two assert on line 222 and 230 gives:

bash-2.05b$ cxx -ieee -std strict_ansi -model ansi -no_pure_cname -I
/boost/regression/boost test.cpp ../long_double_mask.cpp -lm && ./a.out
little endian
sizeof(long double) = 16

mask<long double>::sign = 80000000
mask<long double>::exponent = 00000000
mask<long double>::significand = 00000000
mask<long double>::fraction = ffffffff

Testing float
Assertion failed: (copysign)(x, y) == x, file test.cpp, line 281
IOT/Abort trap

Seems there is generally something odd with the sign bit handling.


Boost list run by bdawes at, gregod at, cpdaniel at, john at