home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!mcsun!chsun!bernina!hanke
- From: hanke@nessie.cs.id.ethz.ch (Norbert Hanke)
- Subject: Re: TP 6.0 Strange rounding problem (Debugger is *lying* to me!)
- Message-ID: <1993Jan11.163815.26799@bernina.ethz.ch>
- Sender: news@bernina.ethz.ch (USENET News System)
- Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
- References: <86406@ut-emx.uucp> <Sorokin.54.726675420@ps1.iaee.tuwien.ac.at> <Sorokin.57.726713348@ps1.iaee.tuwien.ac.at>
- Date: Mon, 11 Jan 1993 16:38:15 GMT
- Lines: 29
-
- In article <Sorokin.57.726713348@ps1.iaee.tuwien.ac.at> Sorokin@ps1.iaee.tuwien.ac.at (Sorokin Zhenya) writes:
- >
- >I've found finally how the rounding is being controlled in 87.
- >Below is a test program which is self-explanatory.
- >
- (some stuff deleted)
- >
- >var cw : word;
- > x:double;
- >begin
- >
- > asm
- > fstcw cw {We take control word and change it. If you are sure,
- > what it should be, you may simply load proper one
- > using only fldcw directive}
- > and cw,blank
- > or cw, r10 {change to r00,r01,r11 to test}
- > fldcw cw
- > end;
- >
- > x:= 513.5;
- > writeln( round(x));
- >end.
-
- Keep in mind that you're using DOUBLE here, and the original poster used
- REAL. The problem might be with that strange Turbo Pascal REAL type.
-
- Norbert Hanke
- ETH Zurich, Switzerland
-