Re: [HACKERS] Floating point error

Поиск
Список
Период
Сортировка
От James Cloos
Тема Re: [HACKERS] Floating point error
Дата
Msg-id m31ubtajmh.fsf@carbon.jhcloos.org
обсуждение исходный текст
Ответ на Re: [HACKERS] Floating point error  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-general
>>>>> "HL" == Heikki Linnakangas <hlinnakangas@vmware.com> writes:

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

hexidecimal notation for floats exists.  The printf format flag is %a
for miniscule and %A for majuscule.

The result of 1./3. is 0xa.aaaaaaaaaaaaaabp-5.

This site has some info and a conversion demo:

http://gregstoll.dyndns.org/~gregstoll/floattohex/

-JimC
--
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6

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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Finding matching words in a word game
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Floating point error