Re:What Every Computer Scientist Should Know About Floating-...
by enriquto on Monday June 29, 2020 @06:13AM
(#23676102)
That seems to be more a problem of strings that of floats, then.
[ Parent
| on HN ]
Re:What Every Computer Scientist Should Know About Floating-...
by rini17 on Monday June 29, 2020 @06:58AM
(#23676347)
Strings have nothing to do with the issue that there is no widespread lossless text exchange format for FP. Instead we round FP numbers while encoding (like "0.3") and then "deround" it while decoding.
(Lossless base10 encoding of 0.3 single precision would be like "10066330*2^-25"..not very readable).
Re:What Every Computer Scientist Should Know About Floating-...
by dahfizz on Monday June 29, 2020 @08:21AM
(#23676891)
> the issue that there is no widespread lossless text exchange format for FP.
If you have to use strings as the intermediate representation (why?) Then printf("%x") and scanf("%x") is perfectly lossless and widespread.
The only thing that's lossy is converting floats to decimal point numbers, which is absolutely silly if it's just two machines communicating.