Re: Range types

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Range types
Дата
Msg-id 407d949e0912150509r2ef2ddc9y5f4fd68be2d5676c@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Range types  (tomas@tuxteam.de)
Ответы Re: Range types  (tomas@tuxteam.de)
Re: Range types  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, Dec 15, 2009 at 7:28 AM,  <tomas@tuxteam.de> wrote:
> The situation is even more restricted with floats (they are much
> smaller; thus one could say that they're more "discrete" than strings,
> even). Problem with floats is -- the granule is not the "same size" over
> the whole range (nasty), and it's all implementation-dependent
> (nastier). But given an implementation, the concept of "next" and
> "previous" on floats is (if you give me some slack with NANs) mostly
> well-defined

In fact, as I only recently found out, one of the design goals of IEEE
floats was specifically that they sort lexicographically and use every
bit pattern. So you can alwys get the "next" float by just
incrementing your float as an 64-bit integer. Yes that raises your
value by a different amount, and it's still useful.

-- 
greg


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

Предыдущее
От: Boszormenyi Zoltan
Дата:
Сообщение: Re: ECPG patch 4.1, out-of-scope cursor support in native mode
Следующее
От: Boszormenyi Zoltan
Дата:
Сообщение: Re: ECPG patch N+1, fix auto-prepare