Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a690ba43
Commit
a690ba43
authored
Dec 14, 2002
by
vva@eagle.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix stupid error in comments to VARIANCE+STD
parent
8eddd4d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
sql/item_sum.h
sql/item_sum.h
+12
-8
No files found.
sql/item_sum.h
View file @
a690ba43
...
...
@@ -255,15 +255,15 @@ class Item_variance_field :public Item_result_field
variance(a) =
= s
qrt ( s
um (ai - avg(a))^2 / count(a) )
=
sqrt ( sum (ai^2 - 2*ai*avg(a) + avg(a)^2) / count(a)
)
=
sqrt ( (sum(ai^2) - sum(2*ai*avg(a)) + sum(avg(a)^2))/count(a)
) =
=
sqrt ( (sum(ai^2) - 2*avg(a)*sum(a) + count(a)*avg(a)^2)/count(a)
) =
=
sqrt ( (sum(ai^2) - 2*sum(a)*sum(a)/count(a) + count(a)*sum(a)^2/count(a)^2 )/count(a)
) =
=
sqrt ( (sum(ai^2) - 2*sum(a)^2/count(a) + sum(a)^2/count(a) )/count(a)
) =
=
sqrt ( (sum(ai^2) - sum(a)^2/count(a))/count(a)
)
= sum (ai - avg(a))^2 / count(a) )
=
sum (ai^2 - 2*ai*avg(a) + avg(a)^2) / count(a
)
=
(sum(ai^2) - sum(2*ai*avg(a)) + sum(avg(a)^2))/count(a
) =
=
(sum(ai^2) - 2*avg(a)*sum(a) + count(a)*avg(a)^2)/count(a
) =
=
(sum(ai^2) - 2*sum(a)*sum(a)/count(a) + count(a)*sum(a)^2/count(a)^2 )/count(a
) =
=
(sum(ai^2) - 2*sum(a)^2/count(a) + sum(a)^2/count(a) )/count(a
) =
=
(sum(ai^2) - sum(a)^2/count(a))/count(a
)
*/
*/
class
Item_sum_variance
:
public
Item_sum_num
{
...
...
@@ -294,6 +294,10 @@ class Item_std_field :public Item_variance_field
double
val
();
};
/*
standard_deviation(a) = sqrt(variance(a))
*/
class
Item_sum_std
:
public
Item_sum_variance
{
public:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment