Re: floating point representation

From: Robert Schrem <Robert(dot)Schrem(at)WiredMinds(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: floating point representation
Date: 2001-02-21 09:19:41
Message-ID: 01022110201801.17287@pc-robert
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I think a formating mode where only the relevant digits are written
to the output would be great as an alternative to the discussed
fixed formatting strings. In this context i think of 'relevant'
as in the following:

'Output as few characters as possible but ensure that scanf is
still able to rebuild the binary reprressentation of the floating
point number exactly.'

To make this happen we would need to compute a seperate formatting
string for each floating point value:

E.g. if the binary value is exactly '1.00000E00' then we just
write '1' to the output, because the rest is just 'ASCII noise'
and not neccessary for rebuilding the identical binary value for
the given floating point value.

The advantage would be, that we only generate as much ASCII data
as absolutly neccessary to rebuild the original data exactly.
At least this is what I would expect from pg_dump.

robert schrem

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2001-02-21 09:41:44 Re: Encoding names
Previous Message Karel Zak 2001-02-21 09:17:36 Encoding names