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

Leading plus sign should be allowed when parsing #206

Open
ghost opened this issue Jun 1, 2020 · 2 comments
Open

Leading plus sign should be allowed when parsing #206

ghost opened this issue Jun 1, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 1, 2020

With native BigInt, BigInt('+10') parses correctly as 10. Unfortunately, using this library, bigInt('+abc', 16) does not correctly parse as 0xabc, even though bigInt('-abc', 16) parses correctly as -0xabc.

This leads to inconsistencies in parsing when the base is equal to 10 compared to other bases. Not sure if I'll have time to submit a PR, but will probably do so if no one gets to this in the next few days.

@Yaffle
Copy link
Collaborator

Yaffle commented Jun 1, 2020

native BigInt does not allow BigInt('-0xabc')

@ghost
Copy link
Author

ghost commented Jun 1, 2020

No, but bigInt(string, 10) defers to BigInt(string) which does allow -10 and +10

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