Skip to content

support for basic arithmetic operations #7

@jkryl

Description

@jkryl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions