Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix add arithmetic to pass dectest ddAdd.dectest #23

Merged
merged 81 commits into from Mar 25, 2019

Conversation

joshcarp
Copy link
Contributor

Passes all halfUp rounding attribute tests in ddAdd.dectest
Does not pass special input tests, weighted Nans and signed Nans

decimal64.go Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
@@ -396,6 +382,7 @@ func TestQuoOverflow(t *testing.T) {
require.Equal(NegInfinity64, MustParseDecimal64("-1e384").Quo(MustParseDecimal64("0")))
require.Equal(QNaN64, Zero64.Quo(Zero64))
require.Equal(Zero64, Zero64.Quo(MustParseDecimal64("100")))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still seeing a new blank line.

decimalSuite_test.go Outdated Show resolved Hide resolved
decimalSuite_test.go Outdated Show resolved Hide resolved
@joshcarp joshcarp requested a review from anzdaddy March 17, 2019 11:01
decimal64.go Outdated Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
decimalSuite_test.go Outdated Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
decimal64.go Show resolved Hide resolved
decimal64.go Outdated Show resolved Hide resolved
decimal64.go Show resolved Hide resolved
decimal64math.go Show resolved Hide resolved
decimal64math.go Show resolved Hide resolved
decimal64scan.go Show resolved Hide resolved
decimal64scan_test.go Outdated Show resolved Hide resolved
decimalSuite_test.go Outdated Show resolved Hide resolved
anzdaddy
anzdaddy previously approved these changes Mar 24, 2019
Copy link
Member

@anzdaddy anzdaddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! One minor naming issue that I'm happy to let slide, since it's an internal function.

decimal64.go Outdated
@@ -305,3 +444,21 @@ func (d Decimal64) Sign() int {
func (d Decimal64) Signbit() bool {
return d.bits>>63 == 1
}

//size returns the magnitude (number of digits) of a uint64.
func size(n uint64) int {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Needs a better name. Suggestion: numDecimalDigits (shorter would be better, but I can't think of anything off the top of my head).

decimal64math.go Outdated
ep.updateMag()
dp.updateMag()
sep := dp.separation(ep)
var ans decParts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move ans down to just before the if that fills it.

@joshcarp joshcarp merged commit feea61d into anz-bank:master Mar 25, 2019
@joshcarp joshcarp deleted the SecondBranch branch April 1, 2019 06:08
joshcarp added a commit to joshcarp/decimal that referenced this pull request Sep 1, 2019
*Add decParts struct for unpacking decimal 

* Fix rounding attributes  and add rounding iotas and structs except for rounding down and round ceiling

* Make struct methods match scales 

* Add decparts oriented matchscales

* Add Nan propagation function, remove SNaN Panics

* Fix Cmps, Add more dectest functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants