in reply to Re^2: Strange rounding Error in Perl
in thread Strange rounding Error in Perl

No, floating point math operations in COBOL are suceptible to the binary to decimal conversion problem too. Defining a picture, or whatever you want to call it is essentially forcing rounding to hide the problem. COBOL allows for fixed decimal numbers, and they're handled differently internally. They're not floating point. For floating point math, the decimal to binary conversion error is still there. You're just not seeing it easily because the language is masking it by rounding, and by not showing all of the available digits, and that is exactly what I meant by saying that languages that don't show this behavior are telling a lie.

Calculators hide the error too, again, by not showing all digits, and by rounding.


Dave