Subject: Re: handling very small doubles
To: Jon Buller <jonb@metronet.com>
From: Matthias Pfaller <leo@dachau.marco.de>
List: port-pc532
Date: 09/15/1998 15:11:24
Jon Buller wrote:
> However, there appears to be a problem with scanf, which may be causing
> some of the problems I'm seeing.  In particular, I tried the following:
>=20
> #include <stdio.h>
> #define DBL_MIN         2.2250738585072014E-308
> void main () {
>   double x;
>   scanf ("%g", &x);
>   printf ("%g   %g %d %d\n", DBL_MIN, x, DBL_MIN =3D=3D x, x =3D=3D 0.0);
> }
>=20
> When I ran it, I cut and pasted the DBL_MIN value and it printed:
>=20
> 2.22507e-308   6.79039e-313 0 0
>=20
> Has anyone seen this before, (or already fixed it?)

I just tried this on a NetBSD/i386 box (which has the same floating
point format as the ns32k) and the result is:

2.22507e-308   6.79039e-313 0 0

So at least this is not NetBSD/pc532 specific.

Matthias
--=20
Matthias Pfaller                            Software Entwicklung
marco Systemanalyse und Entwicklung GmbH    Tel   +49 8131 5161-41
Hans-B=F6ckler-Str. 2, D 85221 Dachau         Fax   +49 8131 5161-66
http://www.marco.de/                        Email leo@dachau.marco.de