Optimize BigInt

This commit is contained in:
Philip Dubé 2024-04-03 23:41:34 +00:00
parent 547861c49b
commit 192072cb5b

View file

@ -1387,9 +1387,7 @@ func (d Decimal) IntPart() int64 {
// BigInt returns integer component of the decimal as a BigInt.
func (d Decimal) BigInt() *big.Int {
scaledD := d.rescale(0)
i := &big.Int{}
i.SetString(scaledD.String(), 10)
return i
return scaledD.value
}
// BigFloat returns decimal as BigFloat.