next up previous contents index
Next: Addr Up: Functions and Procedures Previous: Functions and Procedures

Abs

   

Declaration:

Function Abs (X : Every numerical type) : Every numerical type;

Description:

Abs returns the absolute value of a variable. The result of the function has the same type as its argument, which can be any numerical type.

Errors:

None.

See also:

Round

Example
Program Example1;

{ Program to demonstrate the Abs function. }

Var 
  r : real;
  i : integer;

begin
  r:=abs(-1.0);   { r:=1.0 }
  i:=abs(-21);    { i:=21 }
end.



Michael Van Canneyt
Thu Sep 10 14:02:43 CEST 1998