On 11/25/05, Yukihiro Matsumoto <matz / ruby-lang.org> wrote:
> Hi,
>
> In message "Re: Improving min/max for Range"
>     on Fri, 25 Nov 2005 09:30:39 +0900, Alexander <madevilgenius / gmail.com> writes:
>
> |I think it makes more sense to implement these operations in terms of
> |<=>, like so:
>
> #min makes sense.  I'd like to merge your idea.  #max needs to
> consider about end exclusion.  I'm not sure what (0...1.0).max should
> return.  Error?
>
>                                                         matz.

Good point. I think max should throw if the number doesn't support the
integer protocol; there's simply no way to handle it intelligently.
For int-type types, I suggest that (end.to_int - 1) should be used,
since there is no #pred counterpart to #succ.

Alexander.