home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
TPL60N19
/
TESTPRGS
/
BUG87.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-05-01
|
711b
|
25 lines
PROGRAM BUG87; { demonstrates some strange behavior on 8087/287 }
{$A+,B+,D+,E-,F-,G-,I+,L+,N+,O-,R+,S+,V+,X-}
{$M 16384,0,655360}
VAR X: EXTENDED; { allows storing of denormal }
L: WORD;
BEGIN
WriteLn ('Turbo-Pascal 6.0 floating point exception bug demo program');
WriteLn;
WriteLn ('Continously dividing 4e-4932 by 1.1...');
WriteLn;
X := 4e-4932; { close to smallest normalized EXTENDED number }
FOR L := 1 TO 5 DO BEGIN
X := X / 1.1;
Write (X:25);
IF L > 1 THEN { after 1st iter. underflow w/ flush to zero }
WriteLn (' should be: ', 0.0:25)
ELSE
WriteLn (' should be: ', X:25);
END;
END. { BUG87 }