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