home *** CD-ROM | disk | FTP | other *** search
- PROGRAM BUG87; { Copyright (c) 1990-1993 Norbert Juffa }
-
- { BUG87 demonstrates some strange behavior on 8087/287 when compiled with the
- original BP 7.0 libraries. }
-
-
- {$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 }
- begin { BUG87 }
- end. { BUG87 }