Abs

From UODemo Wiki
Revision as of 21:09, 24 January 2010 by Batlin (talk | contribs) (Protected "Abs" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) [cascading])

Jump to: navigation, search

integer abs(integer AnyInteger);

This returns the absolute value of an integer. Integers range from −2147483648 to +2147483647. Please note that abs(-2147483648) will return -2147483648 since its absolute value 2147483648 is outside the range of the integer type.

if( abs(−2147483647) == 2147483647 )
{
  systemMessage(this, "abs() test succeeded");
}
else
{
  systemMessage(this, "abs() test failed");
}