abs Function

Retrieves the absolute value of a real number.

For example:

  • abs(-100.0) returns the value 100.0.

  • abs(30.56) returns the value 30.56.


real abs(real arg)

Parameter

Description

arg

The number to get the absolute value of.

The absolute value of arg.

static void absExample(Args _args)
{
    real r1;
    real r2;
    ;

    r1 = abs(-3.14);
    r2 = abs(3.14);
    if (r1 == r2)
    {
        print "abs of values are the same";
        pause;
    }
}

Community Additions

ADD
Show: