In article <86406@ut-emx.uucp> mmigdol@ccwf.cc.utexas.edu (michael a migdol) writes:
>
> Quoting from page 120 of "Turbo Pascal Library Reference" for Round(X: real)
>, " If X is exactly halfway between two whole numbers, the result is the number with the greatest absolute magnitude." I don't believe that it's the "money method"
>problem. Do you have any other ideas?
If you just need a proper rounding, you can look into ANY book which
contains a description of 8087/287/387 instructions and find the place where
the rounding setting is described. As far as I remember you must reset a
coprocessor with a parameter word. Then add just a one asm line into your
program and that's it. The problem however may occur if your TP program
performs multiple coprocessor resets. In this case add this statement just
as a first statement to the procedure, which performs rounding. It could be
dangerous to place a reset somewhere in the middle, because the program may
perform some optimization and use a variable in coprocessor stack, which
will be naturally lost after reset.
If you want to discover the problem, then it may become a valuable