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

encodeCustomFloat: "must encode custom floats when they are less than 1" is failing #209

Open
rwaldron opened this issue Dec 28, 2019 · 4 comments

Comments

@rwaldron
Copy link
Collaborator

@dtex I don't understand this failure :|

1) Numeric encoding/decoding and formatting
       must encode custom floats when they are less than 1:

      AssertionError: expected Array [ 69, 2, 0, 20 ] deepEqual Array [ 79, 46, 70, 5 ]
      + expected - actual

       [
      -  69
      -  2
      -  0
      -  20
      +  79
      +  46
      +  70
      +  5
       ]

@rwaldron
Copy link
Collaborator Author

This appears to only occur locally for me 🤷🏼‍♂️

@dtex
Copy link
Contributor

dtex commented Dec 28, 2019

I'm able to replicate in node 12, but works fine in node 10. I can't imagine what has changed but I'll dig into it.

@dtex
Copy link
Contributor

dtex commented Dec 28, 2019

Tired: Off by 1 errors
Wired: Off by 0.00000000000000000001 errors

Here's the scoop:

In node 10:

Math.pow(10, -4) === 0.0001

but in node 12

Math.pow(10, -4) === 0.00009999999999999999

Appears to be this issue which will be fixed by this commit and will eventually make its way to node.js. If we need to, we can comment out that test for now, or we could just leave this issue open and findable until node has the corrected version of v8.

@rwaldron
Copy link
Collaborator Author

rwaldron commented Jan 6, 2020

Thanks for checking into that! I say we take no action on our end and leave this open for folks to easily find.

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

No branches or pull requests

2 participants