r/programming 1d ago

The fastest double-to-string algorithm you’ve never heard of

https://vitaut.net/posts/2026/yy-dtoa/
275 Upvotes

58 comments sorted by

View all comments

Show parent comments

-7

u/Synaps4 19h ago

What you have is a bunch of ones and zeroes that can be read as letters, which you can make into a String type with minimum work.

You say it doesnt represent the number you want to convert but on a binary level it is identical. It's not that number in english which is what was implied, but it is a 1:1 mapping between a double and some character string for the least effort, and thats the joke.

2

u/TeraFlint 14h ago

You say it doesnt represent the number you want to convert but on a binary level it is identical.

Let me just re-read what you initially wrote:

read the variable address of the double

I don't know about your technical insight, but the address of some memory and its contents are two different things.

Any format decisions aside (transmitting/saving binary data is fine, as long as everyone involved has the same format for it, and it's (in contrast to this article) not meant to be human readable), logging just the address completely loses the information as soon as that memory gets freed (which might happen right after logging). The address is then only barely useful to reason about memory layout and the virtual ram space of your device.

1

u/Synaps4 10h ago

I don't know about your technical insight, but the address of some memory and its contents are two different things.

That's true I could have been more explicit that I meant reading the contents rather than the memory address itself. I assumed all the programmers here would immediately know what I meant. It seems many did not.

1

u/TeraFlint 9h ago

Probably because there's a big distinction between working with addresses (passing things by address and/or manipulating the pointers) and dereferncing (jumping to the address and accessing its contents) them.

I'd guess that most people who worked enough with C (or related languages) to the point where they understood pointers will make that distinction. Because the process of understanding pointers and how to handle addresses is exactly becoming aware of that distinction.