End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
BigDecimal#quo
quo(value) → bigdecimal
quo(value, digits) → bigdecimal
ext/bigdecimal/bigdecimal.c
View on GitHub ↗
static VALUE
BigDecimal_quo(int argc, VALUE *argv, VALUE self)
{
VALUE value, digits, result;
SIGNED_VALUE n = -1;
argc = rb_scan_args(argc, argv, "11", &value, &digits);
if (argc > 1) {
n = check_int_precision(digits);
}
if (n > 0) {
result = BigDecimal_div2(self, value, digits);
}
else {
result = BigDecimal_div(self, value);
}
return result;
}
Divide by the specified value.
- digits
-
If specified and less than the number of significant digits of the result, the result is rounded to the given number of digits, according to the rounding mode indicated by
BigDecimal.mode.If digits is 0 or omitted, the result is the same as for the / operator.
See BigDecimal#/. See BigDecimal#div.