File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ func NewFromInt32(value int32) Decimal {
120120// NewFromBigInt returns a new Decimal from a big.Int, value * 10 ^ exp
121121func NewFromBigInt (value * big.Int , exp int32 ) Decimal {
122122 return Decimal {
123- value : big .NewInt ( 0 ).Set (value ),
123+ value : new ( big.Int ).Set (value ),
124124 exp : exp ,
125125 }
126126}
@@ -831,7 +831,7 @@ func (d Decimal) IsInteger() bool {
831831 // When the exponent is negative we have to check every number after the decimal place
832832 // If all of them are zeroes, we are sure that given decimal can be represented as an integer
833833 var r big.Int
834- q := big .NewInt ( 0 ).Set (d .value )
834+ q := new ( big.Int ).Set (d .value )
835835 for z := abs (d .exp ); z > 0 ; z -- {
836836 q .QuoRem (q , tenInt , & r )
837837 if r .Cmp (zeroInt ) != 0 {
@@ -949,7 +949,7 @@ func (d Decimal) Exponent() int32 {
949949func (d Decimal ) Coefficient () * big.Int {
950950 d .ensureInitialized ()
951951 // we copy the coefficient so that mutating the result does not mutate the Decimal.
952- return big .NewInt ( 0 ).Set (d .value )
952+ return new ( big.Int ).Set (d .value )
953953}
954954
955955// CoefficientInt64 returns the coefficient of the decimal as int64. It is scaled by 10^Exponent()
You can’t perform that action at this time.
0 commit comments