Method: BigDecimal#exponent

Defined in:
bigdecimal.c

#exponentObject

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.



2841
2842
2843
2844
2845
2846
# File 'bigdecimal.c', line 2841

static VALUE
BigDecimal_exponent(VALUE self)
{
    ssize_t e = VpExponent10(GetVpValue(self, 1));
    return SSIZET2NUM(e);
}