News for hackers. Stuff that matters.
Re:Rendering floating numbers: advances in problems you didn... by SloopJon on Friday October 30, 2020 @02:15AM (#24939655)
I think Python was the first to bring this into my consciousness. See this enhancement request, which changed the float-to-string conversion from seventeen significant figures to shortest:

https://bugs.python.org/issue1580

After they did that, I learned that Scheme specifies similar behavior. In fact, I think it was added to R4RS after the Steele and White paper. As the article says, this behavior spread across languages, so that it's weird to see something different now.

If you want to nerd out on this, here are a few other posts that explore the topic:

https://www.exploringbinary.com/the-shortest-decimal-string-...

https://www.exploringbinary.com/the-shortest-decimal-string-...

https://www.exploringbinary.com/java-doesnt-print-the-shorte...

There are no comments on this comment yet.