diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 7b23826ac1..f8de8aa5d1 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -1201,7 +1201,7 @@ BigDecimal_pai(VALUE self, VALUE nFig) Real *pv; S_LONG mf; - mf = GetPositiveInt(nFig); + mf = GetPositiveInt(nFig)+VpBaseFig()-1; GUARD_OBJ(pv,VpCreateRbObject(mf, "0")); VpPai(pv); return ToValue(pv);