index

Varkon MBS Programmers manual

# abs - Function

## Description

Returns the absolute (positive) value of an argument as an INT or FLOAT value depending on the type of the argument.

## Syntax

      y:=abs(x);

      int/float y;
      int/float x;

## Principal parameters

x | - An INT or FLOAT value.

## Optional parameters

None.

## Return value

If x is an INT value, abs() returns an INT. If x is a FLOAT value, abs() returns a FLOAT.

## Comments

The abs() function is different from other functions by its dual nature of being both an INT and a FLOAT function. This means that if `i` is an INT, the MBS compiler will accept `i:=abs(55);` but not `i:=abs(55.7);`

Varkon version 1.19C svn# 97