Re: float output precision questions
От | Pedro Miguel Frazao Fernandes Ferreira |
---|---|
Тема | Re: float output precision questions |
Дата | |
Msg-id | 3DBFB2C9.3090906@ualg.pt обсуждение исходный текст |
Ответ на | Re: float output precision questions (Peter Eisentraut <peter_e@gmx.net>) |
Список | 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 tostring 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
В списке pgsql-hackers по дате отправления: