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

Integer#toString has side effects depending on the base #20

Closed
make-github-pseudonymous-again opened this issue Apr 25, 2017 · 1 comment
Assignees
Labels

Comments

@make-github-pseudonymous-again
Copy link
Owner

const x = ZZ.from(10000) ;
x.toString(10); // 10000
x.toString(10); // 10000
x.toString(16); // 2710
x.toString(16); // 2
@make-github-pseudonymous-again
Copy link
Owner Author

The culprit is https://github.com/aureooms/js-integer-big-endian/blob/57303750241797740359d0e41d86c526688b1d76/src/core/convert/_convert_slow.js#L30 . Need to find an elegant/efficient way to allow copying the input array in this case. Should avoid unnecessary copies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant