Re: Range types - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Range types
Date
Msg-id 15105.1260889108@sss.pgh.pa.us
Whole thread Raw
In response to Re: Range types  (Greg Stark <gsstark@mit.edu>)
Responses Re: Range types
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> 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.

There are certainly some low-level numerical analysis situations where
you want to get the "next" float value, but that hardly constitutes
an argument for treating ranges of floats as discrete rather than
continuous.  Normal users of a range datatype aren't going to be
interested in dealing with that sort of inherently machine-specific
behavior.

Even in types where next/previous are well defined, I'm not that
comfortable with having range operations depend on them.  What happens
when one end of your range is INT_MIN or INT_MAX?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Range types
Next
From: Tom Lane
Date:
Subject: Re: Compiling HEAD with -Werror int 64-bit mode