RE: floating point representation

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: floating point representation
Date: 2001-02-16 23:42:26
Message-ID: EKEJJICOHDIEMGPNIFIJAEPODJAA.Inoue@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> -----Original Message-----
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
>
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > The GNU C library now offers a %a (and %A) format that prints floating
> > point numbers in a semi-internal form that is meant to be portable. (I
> > image this was done because of C99, but I'm speculating.) It might be
> > useful to offer this to preserve accurate data across dumps.
>

[snip]
>
> So, it looks like C99-compliant libc implementations will have this,
> but I'd hesitate to rely on it for pg_dump purposes; it would certainly
> not be very portable for awhile yet.
>

Agreed.

> Peter's idea of a SET variable to control float display format might
> not be a bad idea, but what if anything should pg_dump do with it?
> Maybe just crank the precision up a couple digits from the current
> defaults?
>

Currently the precision of float display format is FLT_DIG(DBL_DIG).
It's not sufficent to distinguish float values. As Peter already suggested,
the quickest solution would be to change XXX_DIG constants to variables
and provide a routine to SET the variables. Strictly speaking the precision
needed to distigush float values seems OS-dependent. It seems preferable
to have a symbol to specify the precision.

Regards,
Hiroshi Inoue

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2001-02-16 23:45:14 Re: Open 7.1 items
Previous Message Martin A. Marques 2001-02-16 22:15:17 Re: wish list for 7.2 (ALTER TABLE)