Skip site navigation (1) Skip section navigation (2)

Re: float output precision questions

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Pedro Miguel Frazao Fernandes Ferreira <pfrazao(at)ualg(dot)pt>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: float output precision questions
Date: 2002-10-29 22:19:05
Message-ID: Pine.LNX.4.44.0210291826420.2006-100000@localhost.localdomain (view raw or flat)
Thread:
Lists: 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(at)gmx(dot)net


In response to

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2002-10-29 22:19:22
Subject: Re: string freeze
Previous:From: Peter EisentrautDate: 2002-10-29 22:18:27
Subject: Re: Trigger on 'create table' ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group