-
Do you know any source that will either explain me how to convert a float/double to string or even better provide the complete code for me? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Conversion of floats to string is pretty complicated topic. I'm searching for compact and easy to port sources myself, but the smaller the method, the more flaws it has. Ryu one is the latest research (see a list of implementations there). Of course it matters only if you want precise conversion between float and string. I've only looked at a couple ryu implementations, but the one written in Go is pretty compact and readable, I think. |
Beta Was this translation helpful? Give feedback.
Conversion of floats to string is pretty complicated topic. I'm searching for compact and easy to port sources myself, but the smaller the method, the more flaws it has. Ryu one is the latest research (see a list of implementations there). Of course it matters only if you want precise conversion between float and string.
I've only looked at a couple ryu implementations, but the one written in Go is pretty compact and readable, I think.