abs: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
(Applied Template:MacroFunction)
Line 1: Line 1:
==Function abs==
{{MacroFunction
Returns the absolute value of a number. The absolute value of a number is the number without the sign.
|name=abs
|description=Returns the absolute value of a number. The absolute value of a number is the number without the sign.


===Usage===
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: val = abs(num)]
[h: val = abs(num)]
Line 8: Line 9:
</source>
</source>


===Examples===
|examples=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[r: abs(-3)]
[r: abs(-3)]
Line 18: Line 19:
</source>
</source>
Returns 4.
Returns 4.
}}

Revision as of 06:09, 6 March 2009

abs() Function

Returns the absolute value of a number. The absolute value of a number is the number without the sign.

Usage

[h: val = abs(num)]
[h: val = absolutevalue(num)]

Examples

[r: abs(-3)]

Returns 3.

[r: abs(4)]
Returns 4.