09.12.2012 Views

Basic Characteristics RAPID

Basic Characteristics RAPID

Basic Characteristics RAPID

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Abs Gets the absolute value<br />

Example<br />

Abs is used to get the absolute value, i.e. a positive value of numeric data.<br />

reg1 := Abs(reg2);<br />

Reg1 is assigned the absolute value of reg2.<br />

Return value Data type: num<br />

Arguments<br />

Example<br />

Syntax<br />

The absolute value, i.e. a positive numeric value.<br />

e.g. Input value Returned value<br />

3 3<br />

-3 3<br />

-2.53 2.53<br />

Abs (Input)<br />

Input Data type: num<br />

The input value.<br />

TPReadNum no_of_parts, "How many parts should be produced? ";<br />

no_of_parts := Abs(no_of_parts);<br />

The operator is asked to input the number of parts to be produced. To ensure that<br />

the value is greater than zero, the value given by the operator is made positive.<br />

Abs ’(’<br />

[ Input ’:=’ ] < expression (IN) of num > ’)’<br />

A function with a return value of the data type num.<br />

<strong>RAPID</strong> Reference Manual 9-Abs-1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!