Subject: handling very small doubles
To: None <port-pc532@netbsd.org>
From: Jon Buller <jonb@metronet.com>
List: port-pc532
Date: 09/15/1998 07:46:37
I've been working on getting PostgreSQL running on my pc532 for a
database class I'm taking this semester.  I think it's working well
enough for the class assignments, but it doesn't pass all the
regression tests.

In particular, it appears to use this to differentiate the time
"current" or "epoch" from the Y2K date of "Jan 01, 2000 00:00 GMT".
(Don't ask me why or how, that what I was told, and it appears that
it's supposed to work that way.)

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:

#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 == x, x == 0.0);
}

When I ran it, I cut and pasted the DBL_MIN value and it printed:

2.22507e-308   6.79039e-313 0 0

Has anyone seen this before, (or already fixed it?)

Jon Buller