るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.100秒)

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. kernel p
  5. rsa p

ライブラリ

検索結果

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

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

...lf.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).remain...
...der(3.5) #=> -0.5
//}

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