Compare commits

..

3 commits

Author SHA1 Message Date
Sergey Vasiliev
3b53264ada
Merge 6e54f647f0 into 645a76e5b0 2024-04-06 22:59:00 -02:30
Philip Dubé
645a76e5b0
Optimize BigInt (#359) 2024-04-05 21:43:23 +02:00
Mateusz Woś
ed8f76e893
Drop support for Go versions older than 1.10 (#361)
* Drop support for Go versions older than 1.10
* Remove 1.18 from test suite
2024-04-05 21:41:05 +02:00
4 changed files with 4 additions and 6 deletions

View file

@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
go: [ '1.7.x', '1.18', '1.19', '1.20', '1.21', '1.x' ] go: [ '1.10.x', '1.19', '1.20', '1.21', '1.22', '1.x' ]
name: Go ${{ matrix.go }} name: Go ${{ matrix.go }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View file

@ -22,7 +22,7 @@ Run `go get github.com/shopspring/decimal`
## Requirements ## Requirements
Decimal library requires Go version `>=1.7` Decimal library requires Go version `>=1.10`
## Usage ## Usage

View file

@ -1414,9 +1414,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.

2
go.mod
View file

@ -1,3 +1,3 @@
module github.com/shopspring/decimal module github.com/shopspring/decimal
go 1.7 go 1.10