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

Documentation correction #124

Closed
beached opened this issue Sep 3, 2020 · 3 comments
Closed

Documentation correction #124

beached opened this issue Sep 3, 2020 · 3 comments

Comments

@beached
Copy link

beached commented Sep 3, 2020

Slight correction to https://github.com/ijl/orjson#int The first sentence "JSON only requires that implementations accept integers with 53-bit precision" is not correct. JSON places no restrictions on the scale of number types but allows for reasonable limits. The 53 bit limit is a result of JavaScript using double for the representation of numbers.

@ijl
Copy link
Owner

ijl commented Sep 25, 2020

Ok, thanks, sort of fixed now.

@ijl ijl closed this as completed Sep 25, 2020
@beached
Copy link
Author

beached commented Sep 25, 2020

One option when encoding larger than 53 bit numbers is to make them strings. It's not for all cases, but it's pretty common too I think. Then a BigInt in javascript can use it, many browsers have it as part of the lang now https://caniuse.com/bigint

@ijl
Copy link
Owner

ijl commented Sep 25, 2020

I suppose someone could propose a solution for bigints in #116.

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