home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / pascal / 8039 < prev    next >
Encoding:
Text File  |  1993-01-11  |  1.3 KB  |  41 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!mcsun!chsun!bernina!hanke
  3. From: hanke@nessie.cs.id.ethz.ch (Norbert Hanke)
  4. Subject: Re: TP 6.0 Strange rounding problem (Debugger is *lying* to me!)
  5. Message-ID: <1993Jan11.163815.26799@bernina.ethz.ch>
  6. Sender: news@bernina.ethz.ch (USENET News System)
  7. Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
  8. References: <86406@ut-emx.uucp> <Sorokin.54.726675420@ps1.iaee.tuwien.ac.at> <Sorokin.57.726713348@ps1.iaee.tuwien.ac.at>
  9. Date: Mon, 11 Jan 1993 16:38:15 GMT
  10. Lines: 29
  11.  
  12. In article <Sorokin.57.726713348@ps1.iaee.tuwien.ac.at> Sorokin@ps1.iaee.tuwien.ac.at (Sorokin Zhenya) writes:
  13. >
  14. >I've found finally how the rounding is being controlled in 87.
  15. >Below is a test program which is self-explanatory. 
  16. >
  17. (some stuff deleted)
  18. >
  19. >var cw : word;
  20. >    x:double;
  21. >begin
  22. >  
  23. >  asm
  24. >    fstcw cw         {We take control word and change it. If you are sure,
  25. >                      what it should be, you may simply load proper one
  26. >                      using only fldcw directive}
  27. >    and cw,blank
  28. >    or  cw, r10      {change to r00,r01,r11 to test}
  29. >    fldcw cw
  30. >  end;
  31. >
  32. >  x:= 513.5;
  33. >  writeln( round(x));
  34. >end.
  35.  
  36. Keep in mind that you're using DOUBLE here, and the original poster used
  37. REAL. The problem might be with that strange Turbo Pascal REAL type. 
  38.  
  39. Norbert Hanke
  40. ETH Zurich, Switzerland
  41.