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

wsint64 with small numbers #58

Open
brunopalos opened this issue Feb 13, 2016 · 2 comments
Open

wsint64 with small numbers #58

brunopalos opened this issue Feb 13, 2016 · 2 comments

Comments

@brunopalos
Copy link

Hi,

I think wsint64 has a bug with small positive numbers represented in 64bits. When the more significative 32 bits are all zeros vzposwill be false because value[0] * Number.POSITIVE_INFINITY is NaN, causing the number to be considered negative throwing value smaller than minimum allowed value error.

It seems to work fine with all other kinds of signed numbers.

I suggest a PR to fix this and to consider zero a positive number on that function. Do you agree?

Thanks,
Bruno

@rmustacc
Copy link
Contributor

It'd be great to write a test case that reproduces this and include it along with a PR. Alternatively we should look at dropping all of the old version of the buffer routines that date back to before we added them to node.

@brunopalos
Copy link
Author

Thanks for the feedback. I don't know anything about old version of the buffer routines and I'm not familiar with the code base. So, I'm probably not the best person to help you atm with that, unless it's simpler than I'm aware. :)
However, I think I can make the fix with the scope I have and I'll submit a PR with your first suggestion.

Cheers,
Bruno

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