Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
BigDecimal#precs
precs → array
ext/bigdecimal/bigdecimal.c
View on GitHub ↗
static VALUE
BigDecimal_prec(VALUE self)
{
ENTER(1);
Real *p;
VALUE obj;
rb_category_warn(RB_WARN_CATEGORY_DEPRECATED,
"BigDecimal#precs is deprecated and will be removed in the future; "
"use BigDecimal#precision instead.");
GUARD_OBJ(p, GetVpValue(self, 1));
obj = rb_assoc_new(SIZET2NUM(p->Prec*VpBaseFig()),
SIZET2NUM(p->MaxPrec*VpBaseFig()));
return obj;
}
Returns an Array of two Integer values that represent platform-dependent internal storage properties.
This method is deprecated and will be removed in the future. Instead, use BigDecimal#n_significant_digits for obtaining the number of significant digits in scientific notation, and BigDecimal#precision for obtaining the number of digits in decimal notation.