るりまサーチ

最速Rubyリファレンスマニュアル検索!
10件ヒット [1-10件を表示] (0.019秒)
トップページ > クエリ:numeric[x] > クエリ:begin[x] > クラス:Integer[x]

別のキーワード

  1. numeric step
  2. _builtin numeric
  3. numeric ceil
  4. numeric eql?
  5. numeric angle

ライブラリ

検索結果

Integer#/(other) -> Numeric (114.0)

除算の算術演算子。

...除算の算術演算子。

other が Integer の場合、整商(整数の商)を Integer で返します。
普通の商(剰余を考えない商)を越えない最大の整数をもって整商とします。

other が Float、Rational、Complex の場合、普通の商を other と
...
...側の引数(対象)
@return 計算結果

//emlist[例][ruby]{
7 / 2 # => 3
7 / -2 # => -4
7 / 2.0 # => 3.5
7 / Rational(2, 1) # => (7/2)
7 / Complex(2, 0) # => ((7/2)+0i)

begin

2 / 0
rescue => e
e # => #<ZeroDivisionError: divided by 0>
end
//}

@see Integer#div, Integer#fdiv, Numeric#quo...