This commit is contained in:
Dean Eigenmann 2024-02-19 21:37:10 -07:00 committed by GitHub
commit 7ddc70e1f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1108,10 +1108,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 new(big.Int).Set(d.value)
}
// BigFloat returns decimal as BigFloat.