forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaverage.xml
More file actions
59 lines (59 loc) · 3.13 KB
/
Copy pathaverage.xml
File metadata and controls
59 lines (59 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<doc>
<legacy_id>1369</legacy_id>
<name>average</name>
<type>function</type>
<syntax>
<example>average(<i>numbersList</i>)</example>
</syntax>
<library></library>
<objects>
</objects>
<synonyms>
<synonym>avg</synonym>
<synonym>arithmeticMean</synonym>
<synonym>mean</synonym>
</synonyms>
<classification>
<category>Math, Logic, & Dates</category>
</classification>
<references>
<function tag="max">max Function</function>
<function tag="min">min Function</function>
<function tag="standardDeviation">standardDeviation Function</function>
<function tag="variance">variance Function</function>
<function tag="geometricMean">geometricMean Function</function>
<function tag="harmonicMean">harmonicMean Function</function>
<function tag="median">median Function</function>
<function tag="statRound">statRound Function</function>
<function tag="round">round Function</function>
</references>
<history>
<introduced version="1.0">Added.</introduced>
<changed version="1.1"></changed>
<changed version="6.1"></changed>
</history>
<platforms>
<mac/>
<windows/>
<linux/>
<ios/>
<android/>
</platforms>
<classes>
<desktop/>
<server/>
<web/>
<mobile/>
</classes>
<security>
</security>
<summary><glossary tag="return">Returns</glossary> the arithmetic mean of a list of numbers.</summary>
<examples>
<example>average(4,36,45,50,75) <code><i>-- returns 42</i></code></example>
<example>put average(importedList) into field "Arithmetic Mean"</example>
<example>put average(replaceText(field "Values",return,comma)) into avgValue</example>
</examples>
<description>
<p>Use the <b>average</b> <control_st tag="function">function</control_st> to find the <function tag="value">value</function> that best represents a group of <glossary tag="value">values</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>numbersList</i> is a comma-separated list of numbers, or an <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to such a list, or an <glossary tag="array">array</glossary> containing only numbers.</p><p/><p><b>Value:</b></p><p>The <b>average</b> function <glossary tag="return">returns</glossary> a number.</p><p/><p><b>Comments:</b></p><p>The average of a list of numbers is the sum of the items in the list or elements in the array, divided by the number of items or elements.</p><p/><p>The <b>average</b> <control_st tag="function">function</control_st> can also be written like this:</p><p/><p><code> sum(numbersList)/the number of items in numbersList</code></p><p/><p>If the <i>numbersList</i> is empty, the <b>average</b> <control_st tag="function">function</control_st> returns zero.</p><p/><p><b>Changes:</b></p><p>The ability to use an array was introduced in version 1.1. In previous versions, only lists of numbers could be used with the <b>average</b> <control_st tag="function">function</control_st>.</p><p>Synonyms <b>arithmeticMean</b> and <b>mean</b> were added in version 6.1 to clarify the <b>average</b> function as <i>arithmetic mean</i>.</p>
</description>
</doc>