Re: float output precision questions - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: float output precision questions
Date
Msg-id Pine.LNX.4.44.0210291826420.2006-100000@localhost.localdomain
Whole thread Raw
In response to float output precision questions  (Pedro Miguel Frazao Fernandes Ferreira <pfrazao@ualg.pt>)
Responses Re: float output precision questions  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: float output precision questions  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-hackers
Pedro Miguel Frazao Fernandes Ferreira writes:

> Is there a way to set query output precision to maximum precision ?
> For the type of application I mentioned this is crucial. People want to
> get the 'same' numbers, from querys or dumps, as they inserted them.

There isn't a way right now, but it's planned to be able to dump
floating-point numbers in some binary form (like printf("%A")) to be able
to restore them exactly.  Not sure how that would satisfy the needs of
client interfaces, though.

> Matlab has a toolbox fucntion, claiming maximum precision, to convert
> from its double type (PostgreSQL float8) to string which does a
> sprintf('%25.18g',number).

Do we have some mathematical guarantee that this is sufficient and
necessary?  If so, then it might do.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Trigger on 'create table' ?
Next
From: Peter Eisentraut
Date:
Subject: Re: string freeze