るりまサーチ

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

別のキーワード

  1. numeric step
  2. _builtin numeric
  3. numeric remainder
  4. numeric numerator
  5. numeric polar

ライブラリ

検索結果

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

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

...quo(other).truncate がそれに相当します。

@param 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...