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

128-bit integers #116

Closed
ahopkins opened this issue Jul 19, 2020 · 2 comments
Closed

128-bit integers #116

ahopkins opened this issue Jul 19, 2020 · 2 comments

Comments

@ahopkins
Copy link

Is there any intent to support serialization of large integers beyond 64 bits?

>>> import orjson, json
>>> json.dumps({"q": 111111111111111111111})
'{"q": 111111111111111111111}'
>>> orjson.dumps({"q": 111111111111111111111})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Integer exceeds 64-bit range
@ijl
Copy link
Owner

ijl commented Jul 20, 2020

I don't have any plans. If someone wants to implement this, it needs to roundtrip (serialize and deserialize consistently) and care needs to be taken deserializing integers greater than the 64-bit range written using exponential notation that would become floats right now. What is correct and how do other libraries handle that? Will it be a change in behavior?

@ijl ijl changed the title Large integers 128-bit integers Jul 20, 2020
@ijl ijl added the help wanted Extra attention is needed label Sep 2, 2020
@ijl ijl removed the help wanted Extra attention is needed label Oct 1, 2021
@ijl ijl closed this as completed Feb 25, 2022
@ddelange
Copy link

I guess blocked by serde-rs/json#846 ?

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

3 participants