Skip to content

Commit

Permalink
Optimize BigInt (shopspring#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex authored and epelc committed Apr 7, 2024
1 parent 8c85d56 commit 8f18bd0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions decimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1398,9 +1398,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.
Expand Down

0 comments on commit 8f18bd0

Please sign in to comment.