On Tue, Dec 15, 2009 at 7:28 AM, <to...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers