subtract: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Function subract==
{{MacroFunction
 
|name=subract
|description=
Subtracts the second number from the first number. Then will continue by subtracting the third number (if any from this result), the function continues subtracting until all number arguments are exhausted.
Subtracts the second number from the first number. Then will continue by subtracting the third number (if any from this result), the function continues subtracting until all number arguments are exhausted.


===Usage===
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: num = subtract(num, num, ...)]
[h: num = subtract(num, num, ...)]
</source>
</syntaxhighlight>
 


===Example===
|examples=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
     [r: subtract(10, 2, 4)]
     [r: subtract(10, 2, 4)]
     [r: subtract(9, 10, 3)]
     [r: subtract(9, 10, 3)]
</source>
</syntaxhighlight>
Returns  
Returns  
     4
     4
     -4
     -4
}}
[[Category:Mathematical Function]]

Latest revision as of 23:59, 14 March 2023

subract() Function

Subtracts the second number from the first number. Then will continue by subtracting the third number (if any from this result), the function continues subtracting until all number arguments are exhausted.

Usage

[h: num = subtract(num, num, ...)]

Examples

    [r: subtract(10, 2, 4)]
    [r: subtract(9, 10, 3)]

Returns

   4
-4