Crestron SIMPL+
Mathematical Functions
Language Reference Guide - DOC. 5797G
®
Mathematical Functions Overview
These functions perform general mathematical operations in a given SIMPL+
program by operating on one or more numerical arguments and returning an
INTEGER as a result.
Abs
Name:
Abs
Syntax:
INTEGER Abs(INTEGER SOURCE);
INTEGER Abs(SIGNED_INTEGER or SOURCE);
Description:
Takes the absolute value of SOURCE. If SOURCE is negative, a positive value is
returned. If SOURCE is already positive, the same value is returned.
Parameters:
Takes the absolute value of an INTEGER.
Return Value:
An INTEGER corresponding to the absolute value of SOURCE.
Example:
DIGITAL_INPUT TRIG;
INTEGER I, K;
I=-5;
CHANGE TRIG
{
K=ABS(I);
PRINT("Original Value = %d, Absolute Value = %d\n", I, K);
}
The output would be:
Original Value = -5, Absolute Value = 5
Version:
SIMPL+ Version 1.00
Software
®
SIMPL+
205
Need help?
Do you have a question about the SIMPL+ and is the answer not in the manual?