Method: BigDecimal#precs

Defined in:
bigdecimal.c

#precsArray

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.

Returns:

  • (Array)


498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
# File 'bigdecimal.c', line 498

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;
}