average: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) No edit summary |
m (Text replacement - "<source" to "<syntaxhighlight") |
||
(6 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{MacroFunction | {{MacroFunction | ||
|name=avg | |name=avg | ||
|description= | |||
Calculates the average (or mean) of all of the numbers that are passed in. The mean | |||
is equal to the sum of all the arguments divided by the number of arguments. | |||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h: av = avg(num, num, ...)] | [h: av = avg(num, num, ...)] | ||
[h: av = average(num, num, ...)] | [h: av = average(num, num, ...)] | ||
[h: av = mean(num, num, ...)] | [h: av = mean(num, num, ...)] | ||
</ | </syntaxhighlight> | ||
|example= | |example= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: avg(1, 2, 3, 3, 10)] | [r: avg(1, 2, 3, 3, 10)] | ||
</ | </syntaxhighlight> | ||
Returns 3.8 | Returns 3.8 | ||
}} | }} | ||
[[Category:Mathematical Function]] | [[Category:Mathematical Function]] |
Latest revision as of 20:39, 14 March 2023
avg() Function
Calculates the average (or mean) of all of the numbers that are passed in. The mean
is equal to the sum of all the arguments divided by the number of arguments.
Usage
[h: av = avg(num, num, ...)]
[h: av = average(num, num, ...)]
[h: av = mean(num, num, ...)]
Example
[r: avg(1, 2, 3, 3, 10)]