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

.mod(n) returns .abs().mod(n) for negative numbers #106

Open
juanelas opened this issue Mar 18, 2018 · 0 comments
Open

.mod(n) returns .abs().mod(n) for negative numbers #106

juanelas opened this issue Mar 18, 2018 · 0 comments

Comments

@juanelas
Copy link

juanelas commented Mar 18, 2018

const number = bignum(-5);
console.log(number.mod(6).toString()); // Outputs: 5.  Expected: 1
console.log(number.mod(3).toString()); // Outputs: 2.  Expected: 1
@juanelas juanelas changed the title .mod(n) returns .abs() for negative numbers .mod(n) returns .abs().mod(n) for negative numbers Mar 18, 2018
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

1 participant