Difference between revisions of "Abs"
From UODemo Wiki
(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...') |
|||
(One intermediate revision by the same user not shown) | |||
Line 15: | Line 15: | ||
} | } | ||
</pre></code> | </pre></code> | ||
+ | |||
+ | |||
+ | Return to the [[Command List]]. |
Latest revision as of 10:20, 25 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");
}
Return to the Command List.