Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

BigDecimal#remainder

remainder(p1)

remainder(value)

Returns the remainder from dividing by the value.

x.remainder(y) means x-y*(x/y).truncate

See also #quo #round #precs #sign also in 3.3 · 3.2 · 3.1