divide: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page Divide to divide: Converting page titles to lowercase)
m (Text replacement - "<source" to "<syntaxhighlight")
Line 4: Line 4:


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


|examples=
|examples=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: divide(4, 2)]
[r: divide(4, 2)]
</source>
</source>
Returns 2.
Returns 2.


<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: divide(24, 2, 2)]
[r: divide(24, 2, 2)]
</source>
</source>

Revision as of 17:35, 14 March 2023

divide() Function

Divides the first number by the second number, and then divides that result by the third number --if present-- and so on for all the numbers passed to the function.

Usage

<syntaxhighlight lang="mtmacro" line> [h: props = divide(num, num, ...)] </source>

Examples

<syntaxhighlight lang="mtmacro" line>

[r: divide(4, 2)] </source> Returns 2.

<syntaxhighlight lang="mtmacro" line> [r: divide(24, 2, 2)] </source>

Returns 6.