-
Notifications
You must be signed in to change notification settings - Fork 152
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
bitwise operators on negative numbers #48
Comments
I'm -1 for implementing it, cc @dcousens |
@indutny it has always felt that negative numbers have been an afterthought (IMHO) in |
@dcousens I didn't really thought much about them indeed, and the mentioned reasons are correct. I wonder if it might be a good idea to fix it within next major bump. btw, I think I am convinced that it should be done. |
@indutny if we are going to continue to support negative numbers (I think we should), then yes, it should be done absolutely. |
seems, https://github.com/justmoon/node-bignum throws an error if any
a
orb
is a negative integer fora ^ b
,a & b
,a | b
The behaviour of this operators for negative integers in other libraries and in JavaScript is
as if twos complement arithmetic were used
. ( http://www-cs-students.stanford.edu/~tjw/jsbn/ )I think, you might throw an error while this behaviour is not implemented
The text was updated successfully, but these errors were encountered: