divmod(p1)
Instance Public methods
Divides by the specified value, and returns the quotient and modulus as BigDecimal numbers. The quotient is rounded towards negative infinity.
For example:
require 'bigdecimal'
a = ::new(â42â) b = ::new(â9â)
q,m = a.divmod(b)
c = q * b + m
a == c -> true
The quotient q is (a/b).floor, and the modulus is the amount that must be added to q * b to get a.
Please login to continue.