-
Notifications
You must be signed in to change notification settings - Fork 11
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
Implement the class function #47
Conversation
Had code reviewed by @joshcarp in person and have applied the suggestions:
|
30a575e
to
f519c09
Compare
I have made all the recommended changes suggested by @anzdaddy
|
(Damn, I've got to stop doing reviews as @marcelocantos accidentally!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes still needed, Looks alright though
Hey missed the pointer receiver thing. Change all the decParts methods from |
decimal64.go
Outdated
@@ -474,3 +498,30 @@ func propagateNan(d ...*decParts) *Decimal64 { | |||
} | |||
return nil | |||
} | |||
|
|||
// Class is a miscellaneous operation that takes one operand and provides the class the decimal is in. | |||
// This function is formally documented here http://speleotrove.com/decimal/damisc.html#refclass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight pr creep but all good,
There seems to be some more problems with using outdated methods, but that'll be fixed in the next PR
* Add class function, detect NaN and sNaN * Defined class for negatives, Normals and Infinities * Add subnormal function, complete class function * Add expmin const, refactor class function & add original unit tests back in * Add missing private methods for flavours * Move decparts methods to decimal64decParts.go * Move decParts tests to own file
As this is my first pull request to this project, I thought it would be good to improve the documentation so that when someone new like me starts, they can read the same documentation everyone else has read and learn more about the IEEE 754 revised floating point.
I implemented the class function (more info: http://speleotrove.com/decimal/damisc.html#refclass).
A miscellaneous function that takes in a decimal and returns a string of 10 possibilities:
Also made a minor change to printout from the test suite to space out the logging.