Iabs()

From TinyMUX
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


Description

iabs(integer)

Returns the absolute value of its argument.

Note that unlike abs() the argument must be an integer. A floating point argument will return a result consistent with floor(abs(number)).

Related Topics: abs(), isign(), sign().

Examples

> say iabs(4)
You say "4"
> say iabs(-4)
You say "4"
> say iabs(0)
You say "0"
> say iabs(-3.2)
You say "3"


(Stock helpfile saved for the difference between iabs and abs, which probably bore stating. Also added an example of what happens with a non-integer argument. --Soylent 00:22, 3 December 2005 (EST))