forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaverage.lcdoc
More file actions
47 lines (27 loc) · 1.52 KB
/
average.lcdoc
File metadata and controls
47 lines (27 loc) · 1.52 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
Name: average
Type: function
Syntax: average(<numbersList>)
Summary: <return|Returns> the arithmetic mean of a list of numbers.
Synonyms: avg,arithmeticMean,mean
Introduced: 1.0
OS: mac,windows,linux,ios,android
Platforms: desktop,server,web,mobile
Example:
average(4,36,45,50,75) -- returns 42
Example:
put average(importedList) into field "Arithmetic Mean"
Example:
put average(replaceText(field "Values",return,comma)) into avgValue
Parameters:
numbersList: A comma-separated list of numbers, or an expression that evaluates to such a list, or an array containing only numbers.
Returns: The <average> function <return|returns> a number.
Description:
Use the <average> <function> to find the <value(function)> that best represents a group of <value(glossary)|values>.
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.
The <average> <function> can also be written like this:
sum(numbersList)/the number of items in numbersList
If the <numbersList> is empty, the <average> <function> returns zero.
Changes:
The ability to use an array was introduced in version 1.1. In previous versions, only lists of numbers could be used with the average function.
References: function (control_st), min (function), geometricMean (function), statRound (function), harmonicMean (function), variance (function), round (function), value (function), max (function), median (function), standardDeviation (function), return (glossary), value (glossary)
Tags: math