[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bounded, infinite ranges?



Andyw says:

   ...Naively, one might assume that (size range) could be defined as
   (/ (- (top range) (bottom range)) (by range)).  However, since
   floats are in fact represented finitely, if the "by:" step size for
   range is sufficiently small there might well be too few allowable
   bit patterns to represent the theoretical number of intervals in
   the range.

The elements of the range should be in general calculated as from+I*by
rather than as ((from+by)+by)+by+...  This also guarantees that you
don't get killed by round-off.  On the other hand, it does mean that
more than one element of the range may have the same value.