round帮助如下:
function Round(X: Extended): Int64;
Description
The Round function rounds a real-type value to an integer-type value.
X is a real-type expression. Round returns an Int64 value that is the value of X rounded to the nearest whole number. If X is exactly halfway between two whole numbers, the result is always the even number. This method of rounding is often called 揃anker抯 Rounding?
If the rounded value of X is not within the Int64 range, a run-time error is generated, which can be handled using the EInvalidOp exception.
"If X is exactly halfway between two whole numbers, the result is always the even number"这一句说得很清楚:
如果X恰好是两个整数之间,round的值为与它相近的偶数。
如果你试试round(13.5)得到的将是14
四舍五入最好如下使用:
trunc(x+0.5)