Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2006-09-25 05:18:10

Daniel James wrote:
> Hello,
> From the test results at:
> It appears that std::numeric_limits<long double> might be defined
> incorrectly on OpenBSD on x86 (for example, the 1 + epsilon != 1 test
> is failing for long double). Is there someone with access to this
> operating system who can look into this?
> On FreeBSD long doubles are defined as having the same accuracy as
> doubles, so maybe that's the case for OpenBSD as well? Another
> possibility is that OpenBSD doesn't have floating point functions
> defined for long doubles - but that wouldn't explain why the epsilon
> test is failing.

There are a couple of problems: and you are correct on both counts, there
are no long double versions of the math functions (there are no *l versions,
the std::func versions do have long double overloads but they call the
double versions internally). And numeric_limits<long double> is wrong as
well, see

In fact numeric_limits<long double> has some really strange properties: it's
min/max values correspond to an 80-bit long double with an extended exponent
range, but the digits and epsilon values are those of a 64-bit double. Oh
but LDBL_EPSILON and LDBL_MANT_DIG are correct!

So go figure :-(

BTW the math_info program results were designed to diagnose precisely these
kinds of issues,



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