From: "matz (Yukihiro Matsumoto)" Date: 2012-07-14T15:05:56+09:00 Subject: [ruby-core:46416] [ruby-trunk - Bug #4577][Rejected] (int...float).max should not raise an error Issue #4577 has been updated by matz (Yukihiro Matsumoto). Status changed from Assigned to Rejected After the discussion with core team members, I see no valid reason to make a change, except for vague feeling. So I reject it at the moment. Matz. ---------------------------------------- Bug #4577: (int...float).max should not raise an error https://bugs.ruby-lang.org/issues/4577#change-28037 Author: yimutang (Joey Zhou) Status: Rejected Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: Target version: ruby -v: - =begin (int...float).max (without a block) will raise an error: (({p (1...9.3).max # cannot exclude non Integer end value (TypeError)})) I don't think it should do so. int...float is a valid range object. When I construct such range, there's no error message. The range can call all the Range instance methods. Only when calling single #max, the errmsg seems to tell that the range itself is not valid. #max with a block will not raise the error: (({p (1...9.3).max {|a,b| a <=> b} #=> 9})) I think (1...9.3).max should also return 9( (end_obj-1).ceil ). If you admit the legality of #max(&block), you should also admit #max(). =end -- http://bugs.ruby-lang.org/