Ruby 2.2.0 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Floatクラス > %

instance method Float#%

self % other -> Float[permalink][rdoc]
modulo(other) -> Float

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

[PARAM] other:
二項演算の右側の引数(対象)


# 剰余
3.0 % 1.2   # => 0.6000000000000001
3.0 % 0.0   # ZeroDivisionError