Ian Thurlbeck wrote:
I've found a simple case of a bug in writeln():
program sumbug(input,output);
begin writeln(10.0*0.01); writeln(100.0*0.001); writeln(1.0*0.1); end.
All should print 0.1 I guess, but I get:
% ./bug :.000000000000000e-02 :.000000000000000e-02 1.000000000000000e-01
Interestingly ':' is the next character after '9' in the ASCII table, so it appears to be trying to print out the ASCII chacter for '10' (ten). 10.0e-02 is 0.1 after all !
Correct diagnosis. Thanks. Fix attached (will also be in the next GPC update, of course).
Frank