home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!utcsri!torn!news.ccs.queensu.ca!dmurdoch
- From: dmurdoch@QueensU.CA (Duncan Murdoch)
- Subject: TP 6.0 bug in Comp formatting
- Message-ID: <BrvJ8L.KDB@knot.ccs.queensu.ca>
- Sender: news@knot.ccs.queensu.ca (Netnews control)
- Organization: Queen's University, Kingston, Canada
- Date: Fri, 24 Jul 1992 03:33:57 GMT
- Lines: 29
-
- Here's a bug report I've sent to Borland:
-
- The program below illustrates a bug in the formatting of the Comp type:
- even though the 19th digit is stored accurately, it's always printed as a 0.
-
- {$N+}
- var
- c,d : comp;
- i : integer;
- begin
- c := 1000000000000000000.0;
- writeln('c=',c:0:0);
- for i:=0 to 10 do
- begin
- d := c+i;
- writeln('d=',d:0:0,' d-c=',d-c:0:0);
- end;
- end.
-
- This prints:
-
- c=1000000000000000000
- d=1000000000000000000 d-c=0
- d=1000000000000000000 d-c=1
- d=1000000000000000000 d-c=2
- ... and so on.
-
- Duncan Murdoch
- dmurdoch@mast.queensu.ca
-