3 ms·
Wait how does 1/3 + 25 equal 5.333?
by jer0me 3y ago
Wait how does 1/3 + 25 equal 5.333?
- p1mrx 3y agohttps://archive.org/details/studyofprogrammi0000stan/page/122/mode/2up?q=astonishment https://archive.org/details/studyofprogrammi0000stan/page/12... "Consider the expression 1/3 + 25. In PL/I this expression has the value 5.33333333333. Why? One-third is computed to 15 digits of precision, 14 to the right of the decimal point. Then 25 is coerced to the same precision, losing the most significant digit 2! This does raise an error in PL/I, but the default is to ignore it."
- jer0me 3y agoWow, that is a lot of surprise.