るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.017秒)
トップページ > クラス:Numeric[x] > クエリ:quo[x] > バージョン:2.6.0[x] > クエリ:remainder[x]

別のキーワード

  1. _builtin quo
  2. bigdecimal quo
  3. numeric quo
  4. complex quo
  5. rational quo

ライブラリ

検索結果

Numeric#remainder(other) -> Numeric (54433.0)

self を other で割った余り r を返します。

...other 自身を割る数を指定します。

//emlist[例][ruby]{
p 13.remainder(4) #=> 1
p (11.5).remainder(3.5) #=> 1.0
p 13.remainder(-4) #=> 1
p (-13).remainder(4) #=> -1
p (-13).remainder(-4) #=> -1
p (-11).remainder(3.5) #=> -0.5
//}

@see Numeric#divmod, Numeric#modulo...