Bug: error in writeln output

Frank Heckenbach frank at g-n-u.de
Sat Dec 1 00:09:15 CET 2001


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 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ian7.diff
Type: application/octet-stream
Size: 2331 bytes
Desc: not available
URL: <http://www.g-n-u.de/pipermail/gpc/attachments/20011201/397bfa21/attachment.obj>


More information about the Gpc mailing list