You ask people to decide something for you. Therefore, I can offer the following ideas:
save the value of your division in a double variable.
... var val : Double; begin val := Expression1/expression2; // use single step in debugger to evaluate and store val := Round(val); // now step over this value. ...
Verification using a literal:
val := Round(0.006); val := Round(-0.006);
Observe consistent or inconsistent results, study and publish these results. Remember that there can be many things:
a. What types are involved and what values / loss of accuracy occur?
Q. Are there any integer overflow errors in your calculations that you did not take into account?
C. Does anyone cut back on any results you didn't take into account?
D. Exceptional circumstances; Someone asked in a comment about another function called Round ()? Cpu problem? Memory corruption think creatively, you are a programmer. Turn on Debug-DCU and one step through the code, in CPU mode. Make sure you are in System.pas _ROUND. Use the debug expression evaluator and the debug window to view variable values. Figure it out.
source share