3 ms·
Here's a weird idea that has occurred me from time to time. What if your editor could recognize a binary float, display it in a readable format, and allow you t
by analog31 1y ago
Here's a weird idea that has occurred me from time to time. What if your editor could recognize a binary float, display it in a readable format, and allow you to edit it, but leave it as binary when the file is saved.
Maybe it's discipline-specific, but with the reasonable care in handling floats that most people are taught, I've never had a consequential mishap.
- mort96 1y agoI don't know how you would do that in practice, since every valid sequence of 4 or 8 bytes is a valid float. Maybe you could exclude some of the more unusual NaN representations but it still leaves you with most byte sequences being floats. For example, the ASCII string "Morn", stored as the bytes '0b01001101 0b01101111 0b01110010 0b01101110', could be interpreted as the 32-bit float 0b01101110011100100110111101001101, representing the number 1.8757481691240478e+28. So you couldn't really just have smart "float recognition" built in to an editor as a general feature, you would need some special format which the editor understands which communicates "the following 4 bytes is a single-precision float" or "the following 8-byte is a double-precision float".
- analog31 1y agoGood point. It strikes me that Unicode is already analogous to recognition of multi byte characters. Maybe something along similar lines would work.