PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
tablepress / libraries / vendor / PhpSpreadsheet / Calculation / Statistical / StandardDeviations.php

StandardDeviations.php in TablePress – Tables in WordPress made easy 3.4, at libraries/vendor/PhpSpreadsheet/Calculation/Statistical/StandardDeviations.php

93 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TablePress\PhpOffice\PhpSpreadsheet\Calculation\Statistical;
4
5 class StandardDeviations
6 {
7 /**
8 * STDEV.
9 *
10 * Estimates standard deviation based on a sample. The standard deviation is a measure of how
11 * widely values are dispersed from the average value (the mean).
12 *
13 * Excel Function:
14 * STDEV(value1[,value2[, ...]])
15 *
16 * @param mixed ...$args Data values
17 *
18 * @return float|string The result, or a string containing an error
19 */
20 public static function STDEV(...$args)
21 {
22 $result = Variances::VAR(...$args);
23 if (!is_numeric($result)) {
24 return $result;
25 }
26
27 return sqrt((float) $result);
28 }
29
30 /**
31 * STDEVA.
32 *
33 * Estimates standard deviation based on a sample, including numbers, text, and logical values
34 *
35 * Excel Function:
36 * STDEVA(value1[,value2[, ...]])
37 *
38 * @param mixed ...$args Data values
39 * @return float|string
40 */
41 public static function STDEVA(...$args)
42 {
43 $result = Variances::VARA(...$args);
44 if (!is_numeric($result)) {
45 return $result;
46 }
47
48 return sqrt((float) $result);
49 }
50
51 /**
52 * STDEVP.
53 *
54 * Calculates standard deviation based on the entire population
55 *
56 * Excel Function:
57 * STDEVP(value1[,value2[, ...]])
58 *
59 * @param mixed ...$args Data values
60 * @return float|string
61 */
62 public static function STDEVP(...$args)
63 {
64 $result = Variances::VARP(...$args);
65 if (!is_numeric($result)) {
66 return $result;
67 }
68
69 return sqrt((float) $result);
70 }
71
72 /**
73 * STDEVPA.
74 *
75 * Calculates standard deviation based on the entire population, including numbers, text, and logical values
76 *
77 * Excel Function:
78 * STDEVPA(value1[,value2[, ...]])
79 *
80 * @param mixed ...$args Data values
81 * @return float|string
82 */
83 public static function STDEVPA(...$args)
84 {
85 $result = Variances::VARPA(...$args);
86 if (!is_numeric($result)) {
87 return $result;
88 }
89
90 return sqrt((float) $result);
91 }
92 }
93