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

ujson doesn't handle floating point numbers properly #83

Closed
trottier opened this issue May 6, 2013 · 2 comments
Closed

ujson doesn't handle floating point numbers properly #83

trottier opened this issue May 6, 2013 · 2 comments

Comments

@trottier
Copy link

trottier commented May 6, 2013

json.dumps(1e-40) ==> '1e-40'
json.dumps(1e100) ==> '1e+100'
json.dumps(1.48974985793234e-50) ==> '1.48974985793234e-50'

ujson.dumps(1e-40) ==> '0.0'
ujson.dumps(1e100) ==> '1.000000000000000e+100'
ujson.dumps(1.48974985793234e-50) ==> '0.0'

@jskorpan
Copy link

Yes, that's indeed how it is.

@trottier
Copy link
Author

Wow. Ok. It may be helpful for users of this library if this behavior was documented. I.e., that ujson cannot, by default, represent numbers smaller than 1e-10 (or so). And certainly never any numbers smaller than 1e-17.

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