-
Notifications
You must be signed in to change notification settings - Fork 262
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
Boost.JSON output for numbers with scientific format is incorrect #156
Comments
is there any reason except aesthetic? and why you are posting it here instead of the boost.json developer project? |
Yes, the test application is treating this as an invalid result. It is not making a string to lower or similar before comparing the result to the expected value.
Because this formatting is set somewhere within the test application. As you can se in my minimal example from above, it is not caused by Boost.JSON. Maybe it is set by another JSON library. I do not know why, I have not digged deeper. But it is not the default behaviour of Boost.JSON. |
where is that file? |
https://github.com/miloyip/nativejson-benchmark/blob/master/src/main.cpp#L1139 |
but according to the JSON grammar: https://www.json.org/json-en.html, the exponent char may be one of |
But then this means that the comparision within the benchmark application is incorrect. So Boost.JSON is blamed to be not be fully following the standard by mistake. I am totally fine to rephrase the title of this issue. But currently Boost.JSON is giving a result which seems correct, the test application does not accept it as being correct. When, regarding to the JSON specificition, it is fine to use |
first - according to the doc it seems your example uses second - try to change your code that it parse the string first and serialize it back as string. and then show the result. |
the |
When enabling in main.cpp lines 1139 and 1140 it is showing the differences in parsing. For the Boost.JSON it will for example print this:
Intput from roundtrip24.json is simply
[5e-324]
.Somewhere the formatting is broken. By default Boost.JSON would output
e
instead ofE
:Output:
The exponent e is lower case here. I did not had enough time to search for some formatting settings in the application.
The text was updated successfully, but these errors were encountered: