1 Dec
2001
1 Dec
'01
12:09 a.m.
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 -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html