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

From Pedro Miguel Frazao Fernandes Ferreira
Subject Re: float output precision questions
Date
Msg-id 3DBFB45A.3030103@ualg.pt
Whole thread Raw
In response to Re: float output precision questions  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: float output precision questions  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-hackers
Stephan Szabo wrote:
> On Tue, 29 Oct 2002, Peter Eisentraut wrote:
> 
> 
>>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.
>>
> 
> How do you define maximum precision and "same"?  With simple test programs
> in C, using two digits more than DBL_DIG for printf specifier, it's easy
> for me to find numbers that "change" decimal string representation in the
> decimal representation -> double -> decimal representation conversion(*).
> The final double you get from the second conversion should be the same as
> the first, but is that what you need or do you need a stronger guarantee
> than that?

When I say "same" I am talking about having a number 'stored' in double 
format in some client, inserting it in PostgreSQL float8 field and get 
it to the client as it was before:
  [Some client]  (insert)   [PostgreSQL]  (query)  [Some client]
(double number a)-------->(float8 number)------->(double number b)

"same" is so that a==b is true.
With current float8 output this is not allways true.

I believe this should allways be true for numbers which are originally 
stored in double format.

Thanks,
Pedro M. Ferreira

> 
> 
> 
> 


-- 
----------------------------------------------------------------------
Pedro Miguel Frazao Fernandes Ferreira
Universidade do Algarve
Faculdade de Ciencias e Tecnologia
Campus de Gambelas
8000-117 Faro
Portugal
Tel./Fax:  (+351) 289 800950 / 289 819403
http://w3.ualg.pt/~pfrazao



pgsql-hackers by date:

Previous
From: Pedro Miguel Frazao Fernandes Ferreira
Date:
Subject: Re: float output precision questions
Next
From: Pedro Miguel Frazao Fernandes Ferreira
Date:
Subject: Re: float output precision questions