EasyManua.ls Logo

Crestron SIMPL+ - SIMPL+ Mathematical Functions; Mathematical Functions Overview; Abs Function

Crestron SIMPL+
374 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Crestron SIMPL+
®
Software
Language Reference Guide - DOC. 5797G SIMPL+
®
z 205
Mathematical Functions
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

Table of Contents