-
Notifications
You must be signed in to change notification settings - Fork 99
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
Honest output request #211
Comments
hello @user45643,
known shortcomings:
|
This was referenced May 14, 2022
Thanks! The code here isn't necessarily fit for direct consumption, and may need additional work to get the output you want. Note that libstdc++ uses the algorithm from here to generate the output you want (I think) from the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Amazing work. Lots more people would love to use it, it just needs a tiny polish. If I may say my piece..
The readme.md states "...The stored value is exactly 0.300000011920928955078125. However, this floating point number is also the closest number to the decimal number 0.3, so that is what Ryu outputs."
But it doesn't actually do that. Does it?
That "0.3" output that you quoted is what most potential users want. But your code doesn't do that. "3E-1"
Consider: The people at the following link want to use your code: but they don't because it doesn't actually do what your readme said: "https://discuss.python.org/t/faster-float-string-conversion-ryu/2466/4". They are unable to use your code as a drop in replacement for dtoa, because your code does not output the non-scientific format prefered for reasonable exponents.
Consider: It looks like your issue #199 user is also disapointed and either uses a seperate c++ specific tool to try and fudge the output (defeating the purpose of ryu being faster than dtoa), or they went away disapointed: "#199" "Not getting the shortest decimal representation of 0.3". I am a C user, so I cannot do that fudge.
Methinks you are starting to get quite a lot of issues raised that indirectly stem from your code outputting scientific notation for exponents close to 0.
Solution? It would be nice, if possible, if your could add a f2s_nonscientific() function. I would really love a function that can be passed a threshold for the range of exponents to print traditionally before switching to scientific notation. Or a function that gives the same output as dtoa, but faster, to popularise your superior work. That's why we are here.
The other option would be to remove the sadly false claim from the readme.md
The text was updated successfully, but these errors were encountered: