4 ms·
They also expect 1/3 + 1/3 + 1/3 == 1. Decimals won't help with that.
by gjm11 4y ago
They also expect 1/3 + 1/3 + 1/3 == 1. Decimals won't help with that.
- kbenson 4y agoThat's slightly different in that most programmers won't read 1/3 as "one third" but instead "one divided by three", and interpret that as three divisions added together, and the expectations are different. Seeing a constant written as a decimal invites people to think of them as decimals, rather than the actual internal representation, which is often "the float that most closely represents or approximates that decimal".