INPUT /  OUTPUT /  LANGUAGE






abs tag

Category: ephemeral logic tag

Obtains the absolute value of one or more values.

The absolute value of a number is the unsigned magnitude of that number. In other words, it is the value of that number with any negative sign removed.

Sample usage

<abs -10> produces the value 10.

<abs -10, 0, 1, 2, -3.5> produces the values 10, 0, 1, 2, 3.5.

<abs {-10}> produces invalid, since {-10} defines a string of text characters, not a numerical value.

Fields

Primary field

Category: vector field

The abs tag's primary field accepts a list of zero or more values. Nominally, this would be one or more numerical values.

Behaviour

When the tag is complete, it produces the absolute value of each element in its primary field. The tag's lifetime then ends.

Example

The following example takes two predefined values (stored in scalars named val1 and val2), subtracts one from the other and then takes the absolute value in order to tell the user the magnitude of the difference between the two values.

<val1:scalar=6>
<val2:scalar=8>
The difference between <val1> and <val2> is <abs|sub val1,val2>.

The following is presented to the user:

The difference between 6 and 8 is 2.