abs

From ZDoom Wiki

Jump to: navigation, search

This function can be used to return the absolute value of a negative integer.

function int abs (int x)
{
    if (x < 0)
        return -x;

    return x;
}
Retrieved from "http://zdoom.org/wiki/Abs"
Personal tools