Pascal Wiki
Advertisement

The trunc function delivers the integer part of its argument. All positions after the decimal point are removed.

Syntax[]

procedure trunc(x: real);

Example[]

 writeln(trunc(123.560)); // delivers 123
writeln(trunc(-123.456)); // delivers -123

See also[]

  • Frac
  • Int
  • Round
Advertisement