1件ヒット
[1-1件を表示]
(0.100秒)
別のキーワード
ライブラリ
- ビルトイン (1)
検索結果
-
Integer
# div(other) -> Integer (43.0) -
整商(整数の商)を返します。 普通の商(剰余を考えない商)を越えない最大の整数をもって整商とします。
...ます。
普通の商(剰余を考えない商)を越えない最大の整数をもって整商とします。
other が Integer オブジェクトの場合、Integer#/ の結果と一致します。
div に対応する剰余メソッドは modulo です。
@param other 二項演算の右側......=> 3
begin
2.div(0)
rescue => e
e # => #<ZeroDivisionError: divided by 0>
end
begin
2.div(0.0)
rescue => e
e # => #<ZeroDivisionError: divided by 0>
# Integer#/ と違い、引数が Float でもゼロで割ることはできない
end
//}
@see Integer#fdiv, Integer#/, Integer#modulo...