Re: [GENERAL] Floating point error

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: [GENERAL] Floating point error
Дата
Msg-id 51360209.1020807@vmware.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Floating point error  (Kevin Grittner <kgrittn@ymail.com>)
Ответы Re: [GENERAL] Floating point error  (James Cloos <cloos@jhcloos.com>)
Список pgsql-hackers
On 05.03.2013 15:59, Kevin Grittner wrote:
> Daniel Farina<daniel@heroku.com>  wrote:
>
>> This kind of change may have many practical problems that may
>> make it un-pragmatic to alter at this time (considering the
>> workaround is to set the extra float digits), but I can't quite
>> grasp the rationale for "well, the only program that cares about
>> the most precision available is pg_dump".  It seems like most
>> programs would care just as much.
>
> Something to keep in mind is that when you store 0.01 into a double
> precision column, the precise value stored, when written in
> decimal, is:
>
> 0.01000000000000000020816681711721685132943093776702880859375
>
> Of course, some values can't be precisely written in decimal with
> so few digits.

It would be nice to have a base-2 text format to represent floats. It
wouldn't be as human-friendly as base-10, but it could be used when you
don't want to lose precision. pg_dump in particular.

- Heikki


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: Support for REINDEX CONCURRENTLY
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Materialized views WIP patch