Difference between revisions of "Abs"

From UODemo Wiki
Jump to: navigation, search
(Created page with 'integer '''abs'''(integer ''AnyInteger''); This returns the absolute value of an integer. Integers range from −2147483648 to +2147483647. Please note that abs(-2147483648) wil...')
 
m (Protected "Abs" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) [cascading])
(No difference)

Revision as of 21:09, 24 January 2010

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");
}