End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
BigDecimal#precision_scale
precision_scale → [integer, integer]
ext/bigdecimal/bigdecimal.c
View on GitHub ↗
static VALUE
BigDecimal_precision_scale(VALUE self)
{
ssize_t precision, scale;
BigDecimal_count_precision_and_scale(self, &precision, &scale);
return rb_assoc_new(SSIZET2NUM(precision), SSIZET2NUM(scale));
}
Returns a 2-length array; the first item is the result of BigDecimal#precision and the second one is of BigDecimal#scale.
See BigDecimal#precision. See BigDecimal#scale.