You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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.
Hi,
I think wsint64 has a bug with small positive numbers represented in 64bits. When the more significative 32 bits are all zeros
vzpos
will be false becausevalue[0] * Number.POSITIVE_INFINITY
isNaN
, 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
The text was updated successfully, but these errors were encountered: