Ruby 4.0 リファレンスマニュアル

instance method Float#%

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

selfother で割った余り(剰余)を返します。

Float オブジェクトを左項とする算術演算子 % はこのメソッドの呼び出しになります。

[PARAM] other:
self に対する除数
# 剰余
p 3.0 % 1.2 # => 0.6000000000000001
3.0 % 0.0   # ZeroDivisionError