mirror of
https://github.com/shopspring/decimal.git
synced 2024-11-22 20:40:48 +01:00
Optimize BigInt (#359)
This commit is contained in:
parent
ed8f76e893
commit
645a76e5b0
1 changed files with 1 additions and 3 deletions
|
@ -1406,9 +1406,7 @@ func (d Decimal) IntPart() int64 {
|
||||||
// BigInt returns integer component of the decimal as a BigInt.
|
// BigInt returns integer component of the decimal as a BigInt.
|
||||||
func (d Decimal) BigInt() *big.Int {
|
func (d Decimal) BigInt() *big.Int {
|
||||||
scaledD := d.rescale(0)
|
scaledD := d.rescale(0)
|
||||||
i := &big.Int{}
|
return scaledD.value
|
||||||
i.SetString(scaledD.String(), 10)
|
|
||||||
return i
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// BigFloat returns decimal as BigFloat.
|
// BigFloat returns decimal as BigFloat.
|
||||||
|
|
Loading…
Reference in a new issue