るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.222秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:n[x] > クエリ:a[x] > クエリ:main[x] > クラス:Numeric[x]

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n
  3. rsa n=
  4. pop n_mails
  5. openssl n

ライブラリ

検索結果

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

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

...ther).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...