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

support for basic arithmetic operations #7

Open
jkryl opened this issue Apr 15, 2014 · 1 comment
Open

support for basic arithmetic operations #7

jkryl opened this issue Apr 15, 2014 · 1 comment

Comments

@jkryl
Copy link

jkryl commented Apr 15, 2014

it would be nice if int64-native supported basic arithmetic operations (add and sub), so that people don't have to implement their own versions of such operations in JS (especially if they can be done so easily in C/C++). Arithmetic brings a problem of distinguishing between signed and unsigned representation of numbers. I have created a patch and made my life easier by treating all int64 numbers as unsigned and let user to determine how he wants to treat the result (i.e. by calling either toUnsignedDecimal() or toSignedDecimal() method), because the internal representation of the number whether it's signed or unsigned remains the same.

If people agree that this would be nice thing to have, I can submit a pull request.

@candu
Copy link
Owner

candu commented Apr 16, 2014

Sounds reasonable - submit a pull request and I'll take a look at it :)

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