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

JSON: Fix complex64 encoding precision #1011

Merged
merged 4 commits into from Sep 10, 2021
Merged

JSON: Fix complex64 encoding precision #1011

merged 4 commits into from Sep 10, 2021

Commits on Sep 10, 2021

  1. JSON encoder: Test several corner cases

    Per #1010, #1002, and #995, some of the corner cases where precision is
    changed or lost aren't fully tested.
    
    Add test cases for corner cases for a number of these:
    
    - complex{64, 128}:  Test incorrect precision and negatives
    - float{32, 64}: Test incorrect precision
    - int{8, 16, 32, 64}: Test minimum and maximum values
    - uint{8, 16, 32, 64}: Test maximum values
    
    Per #1010, the test for complex64 incorrect precision is currently
    failing.
    abhinav committed Sep 10, 2021
    Copy the full SHA
    6b69a5a View commit details
    Browse the repository at this point in the history
  2. JSON encoder: Use correct precision for Complex64

    Converting to Complex128 meant that the real and imaginary components of
    the Complex64 were encoded as float64s which, like #1002, ended up
    those components with the incorrect precision.
    
    Fix this by adding a precision parameter to appendComplex tp specify the
    precision with which the two components of the complex number should be
    encoded.
    abhinav committed Sep 10, 2021
    Copy the full SHA
    af0cbd1 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    7255fee View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    e272362 View commit details
    Browse the repository at this point in the history