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

Review and round out decimal64 testing #1

Open
anzdaddy opened this issue Dec 21, 2018 · 5 comments
Open

Review and round out decimal64 testing #1

anzdaddy opened this issue Dec 21, 2018 · 5 comments
Labels
❗ anz approval prereq Required for use in ANZ production systems

Comments

@anzdaddy
Copy link
Member

anzdaddy commented Dec 21, 2018

A key concern is accurate numeric outcomes for all arithmetic operations, including parsing and formatting. The last thing we want is some variant of 0.1 + 0.1 + 0.1 ≠ 0.3.

Some thought needs to go into the completeness of the tests such that all conceivable edge cases are covered. The following is a reasonably thorough but incomplete set of cases to consider.

  1. Boundaries such the largest and smallest possible exponent
  2. Every combination of positive and negative arguments
  3. Every combination of kinds of arguments (SNaN, QNaN, ±∞, ±normal, ±subnormal, ±0)
    1. Make sure to include the largest and smallest ±normals and ±subnormals.
  4. Numbers close to ±0
  5. The smallest normal number and its neighborhood
  6. ±10ⁱ and its neighborhood for every representable i
  7. ±2ⁱ and its neighborhood for every representable i
  8. Operations jumping numbers into different phases (e.g., doubling ±the largest number = ±∞, halving ±the smallest number = ±0. Consider this for every operation
  9. Parsing massive numeric representations (e.g., a number with 5000 digits)
  10. Parsing out of range numbers (e.g., 1E1234 or 1E-1000)
@anzdaddy anzdaddy added the ❗ anz approval prereq Required for use in ANZ production systems label Dec 23, 2018
@juliaogris juliaogris pinned this issue Jan 3, 2019
@juliaogris
Copy link
Contributor

Test underflow scenarios for Add/Quo, etc. (Min/2 = 0) in decimal64math_test.go

@joshcarp
Copy link
Contributor

Some ideas:
Test against randomly generated input data and test output agains reference example
ibm have a c implementation: http://speleotrove.com/decimal/
This is based off the IEEE standard, that then was implemented in an ISO standard: ISO/IEC/IEEE 60559:2011

Another idea was to just use the test cases that the C standard uses for their decimal type:
http://speleotrove.com/decimal/dectest.html

Although we haven't implemented rounding attributes or expendable precision isn't working in our repo so the test cases will need to be filtered

@anzdaddy
Copy link
Member Author

A reference implementation for testing is a great idea! #17

@joshcarp
Copy link
Contributor

Current known issues:
SNaN behaviour,
Payload Nans
Rounding attributes
Invalid inputs parsed to NaNs

Faults found from decTest/ddAdd.decTest http://speleotrove.com/decimal/dectest.html

@joshcarp
Copy link
Contributor

payload Nans act as a way to provide extra context to the NaN and need to be supported for libraries that may use the decimal package in the future

ie
NaN8
-sNaN27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❗ anz approval prereq Required for use in ANZ production systems
Projects
None yet
Development

No branches or pull requests

3 participants