[Overview][Constants][Types][Classes][Procedures and functions][Variables] | Reference for unit 'System' (#rtl) |
Round floating point value to nearest integer number.
Source position: mathh.inc line 68
function round( |
d: ValReal |
):Int64; |
Round rounds X to the closest integer, which may be bigger or smaller than X.
In the case of .5, the algorithm uses "banker's rounding": .5 values are always rounded towards the even number.
None.
|
Return fractional part of floating point value. |
|
|
Calculate integer part of floating point value. |
|
|
Truncate a floating point value. |
Program Example54; { Program to demonstrate the Round function. } begin Writeln (Round(1234.56)); { Prints 1235 } Writeln (Round(-1234.56)); { Prints -1235 } Writeln (Round(12.3456)); { Prints 12 } Writeln (Round(-12.3456)); { Prints -12 } Writeln (Round(2.5)); { Prints 2 (down) } Writeln (Round(3.5)); { Prints 4 (up) } end.
No notes exist for this page yet.