Optimize BigInt (#359)

This commit is contained in:
Philip Dubé 2024-04-05 19:43:23 +00:00 committed by GitHub
parent ed8f76e893
commit 645a76e5b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1406,9 +1406,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.