> We all grew up learning math before programming, and mathematically speaking, there is no qualitative difference between 15 and 14.7
IMO, there is a huge qualitative difference between 15 and 14.7; 15 is an integer, while 14.7 isn’t.
I also think most people would know that instinctively. Reason? I think most people learn arithmetic progressing more or less along these lines:
- positive integers
- non-negative integers (i.e. learning and understanding the concept of ‘zero’)
- non-negative rationals
- all rationals
- decimal fractions
- all reals
Phrased another way: I would think the majority of people would learn to count to 15 long before learning what 14.7 means.
Also, as sfpotter already said, switching to doubles only isn’t a panacea. Neither are bigints (won’t help representing the result of ⅓ exactly, for example), rationals (won’t help representing the typical hypothenuse of a triangle exactly, for example), or radicals (won’t help computing the area of a unit circle exactly)
A CAS would help, but by then, you’re giving up lots and lots of performance.
(that doesn’t mean I am a fan of languages that silently round integer division. Silently moving to bigints and rationals IMO can be a good choice, but silently moving from an exact type to an inexact one IMO never is)