1件ヒット
[1-1件を表示]
(0.037秒)
クラス
- Integer (1)
検索結果
-
Integer
# div(other) -> Integer (54508.0) -
整商(整数の商)を返します。 普通の商(剰余を考えない商)を越えない最大の整数をもって整商とします。
整商(整数の商)を返します。
普通の商(剰余を考えない商)を越えない最大の整数をもって整商とします。
other が Integer オブジェクトの場合、Integer#/ の結果と一致します。
div に対応する剰余メソッドは modulo です。
@param other 二項演算の右側の引数(対象)
@return 計算結果
//emlist[例][ruby]{
7.div(2) # => 3
7.div(-2) # => -4
7.div(2.0) # => 3
7.div(Rational(2, 1)) # => 3
begin
2.div(0)
rescue => ...