This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: 18/numeric_limits fail on solaris 2.8
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Paolo Carlini <pcarlini at unitus dot it>
- Cc: gdr at codesourcery dot com, libstdc++ at gcc dot gnu dot org
- Date: Mon, 1 Apr 2002 11:07:56 -0800 (PST)
- Subject: Re: 18/numeric_limits fail on solaris 2.8
> I did'nt notice that the tests are /doubled/ exactly for the
> "abs-reason". Therefore no abs are needed at all... Sorry again, please
> disregard my point about absolute values. The tests looks good.
Ok.
For this "C" program,
#include <assert.h>
#define LDBL_MANT_DIG 113
#define LDBL_EPSILON 1.925929944387235853055977942584927319E-34L
#define LDBL_DIG 33
#define LDBL_MIN_EXP (-16381)
#define LDBL_MIN 3.362103143112093506262677817321752603E-4932L
#define LDBL_MIN_10_EXP (-4931)
#define LDBL_MAX_EXP (+16384)
#define LDBL_MAX 1.189731495357231765085759326628007016E+4932L
#define DEFINE_EXTREMA(T, m, M) \
T min = m; \
T max = M
DEFINE_EXTREMA(long double, LDBL_MIN, LDBL_MAX);
int main()
{
long double ldmin = LDBL_MIN;
long double ldmax = LDBL_MAX;
assert (ldmin == min);
assert (ldmax == max);
return 0;
}
I get:
(gdb) p ldmin
$1 = 1.3906711615670008644313954483327525e-309
(gdb) p ldmax
$2 = nan(0xeffffffffffff)
(gdb) p min
Cannot access memory at address 0x2fdbe8
(gdb) p max
Cannot access memory at address 0x2fdbf8
... this is about as far as I want to take this, but clearly something is
wrong.
-benjamin