永井@知能.九工大です.

>>>>> "t" == ttate  <ttate / jaist.ac.jp> writes:
t> 例えば、
t> v = 1.2
t> v.to_i(:ceil)
t> の方がいいかなぁと思っただけなんです。

ってことは,

class Float
  alias orig_to_i to_i
  def to_i(mode = :floor)
    case mode
    when :floor
     self.orig_to_i
    when :ceil
     (self + (self<=>0)).orig_to_i
    when :round
     (self + (self<=>0)*0.5).orig_to_i
    end
  end
end

という感じでしょうか? (シンボル名はともかくとして)

# to_i が遅くなるだけで,あんまり嬉しくないような...(^_^;

-- 
                                         永井 秀利 (九工大 知能情報)
                                             nagai / ai.kyutech.ac.jp