3 ms·
I just think of floats as fuzzy analog values. The only precise operation you can do is copying. Everything else, you assume it's noisy. It's not real analog
by eternityforest 3y ago
I just think of floats as fuzzy analog values. The only precise operation you can do is copying. Everything else, you assume it's noisy.
It's not real analog noise, but reasoning about rounding is hard if you're not good at math, it's something you can explain easily, and it prevents you from doing clever stuff that will confuse the next person.
It's the opposite of being an idea person. I just accept them as a practical approximation, not a tool for doing real math, and move on. If you come from electronics it makes perfect sense. Voltages are pretty much always noisy even if it's picovolts.
If I need precision I use ints or dedicated libraries.