るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

キーワード

検索結果

Float#modulo(other) -> Float (23102.0)

算術演算子。剰余を計算します。

算術演算子。剰余を計算します。

@param other 二項演算の右側の引数(対象)

//emlist[例][ruby]{
# 剰余
3.0 % 1.2 # => 0.6000000000000001
3.0 % 0.0 # ZeroDivisionError
//}

Float#divmod(other) -> [Numeric] (8007.0)

self を other で割った商 q と余り r を、 [q, r] という 2 要素の配列にして返します。 商 q は常に整数ですが、余り r は整数であるとは限りません。

...ます。

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

//emlist[例][ruby]{
11.divmod(3) # => [3, 2]
(11.5).divmod(3.5) # => [3, 1.0]
11.divmod(-3) # => [-4, -1]
11.divmod(3.5) # => [3, 0.5]
(-11).divmod(3.5) # => [-4, 3.0]
//}

@see Numeric#div, Numeric#modulo...

Float#%(other) -> Float (8002.0)

算術演算子。剰余を計算します。

算術演算子。剰余を計算します。

@param other 二項演算の右側の引数(対象)

//emlist[例][ruby]{
# 剰余
3.0 % 1.2 # => 0.6000000000000001
3.0 % 0.0 # ZeroDivisionError
//}