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

instance method Integer#divmod

divmod(other) -> [Integer, Numeric]Ruby 2.4.0 から[permalink][rdoc][edit]
(Integer) → [ Integer, Integer ]
(Float) → [ Integer, Float ]
(Rational) → [ Integer, Rational ]
(Numeric) → [ Numeric, Numeric ]

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

[PARAM] other:
self に対する除数

[SEE_ALSO] Numeric#divmod