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

Re: float output precision questions

From: Pedro Miguel Frazao Fernandes Ferreira <pfrazao(at)ualg(dot)pt>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: float output precision questions
Date: 2002-10-30 10:22:01
Message-ID: 3DBFB2C9.3090906@ualg.pt (view raw or flat)
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> 
>>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.

It is necessary if you want to do this type of (huge amount of number 
storage) application:

  [Some client] (insert)  [PostgreSQL]  (query)  [Some client]
(double number a)-------->(float8 number)------->(double number b)

In order for a=b this is necessary. With current float8 output this is 
not allways true.

Here is the help for that particular Matlab function:

  NUM2MSTR Convert number to string in maximum precision.
     S = NUM2MSTR(N) converts real numbers of input
     matrix N to string output vector S, in
     maximum precision.

     See also NUM2STR.

If you want I can try to contact the guys who coded this function to know
if this is sufficient.

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


In response to

pgsql-hackers by date

Next:From: Pedro Miguel Frazao Fernandes FerreiraDate: 2002-10-30 10:28:42
Subject: Re: float output precision questions
Previous:From: Adam WitneyDate: 2002-10-30 09:25:51
Subject: Re: 7.3b3 on MacOSX 10.2.1

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