[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'System' (#rtl)

round

Round floating point value to nearest integer number.

Declaration

Source position: mathh.inc line 58

function round(

  d: ValReal

):Int64;

Description

Round rounds X to the closest integer, which may be bigger or smaller than X.

Errors

None.

See also

Frac

  

Return fractional part of floating point value.

Int

  

Calculate integer part of floating point value.

Trunc

  

Truncate a floating point value.

Example

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   }
end.