From 192072cb5b3e362504eff8adbc4bace63ebf0697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Wed, 3 Apr 2024 23:41:34 +0000 Subject: [PATCH] Optimize BigInt --- decimal.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/decimal.go b/decimal.go index 24a8aa3..92cf8a7 100644 --- a/decimal.go +++ b/decimal.go @@ -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.