End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
BigDecimal#exponent
exponent
ext/bigdecimal/bigdecimal.c
View on GitHub ↗
static VALUE
BigDecimal_exponent(VALUE self)
{
ssize_t e = VpExponent10(GetVpValue(self, 1));
return SSIZET2NUM(e);
}
Returns the exponent of the BigDecimal number, as an Integer.
If the number can be represented as 0.xxxxxx*10**n where xxxxxx is a string of digits with no leading zeros, then n is the exponent.