fixes recurring bug
This commit is contained in:
@@ -17,4 +17,15 @@ INSERT INTO t VALUES(4, 'B', 40)
|
||||
INSERT INTO t VALUES(4, 'B', 80)
|
||||
|
||||
|
||||
SELECT * FROM t
|
||||
SELECT * FROM t
|
||||
|
||||
FUNCTION myCov(x, y) {
|
||||
center_x := x - avg(x);
|
||||
center_y := y - avg(y);
|
||||
num := sum(center_x * center_y);
|
||||
denom := sqrt(sum(center_x * center_x)) * sqrt(sum(center_y * center_y));
|
||||
num / denom
|
||||
}
|
||||
|
||||
|
||||
select myCov(1,2);
|
||||
@@ -1,10 +0,0 @@
|
||||
FUNCTION myCov(x, y) {
|
||||
center_x := x - avg(x);
|
||||
center_y := y - avg(y);
|
||||
num := sum(center_x * center_y);
|
||||
denom := sqrt(sum(center_x * center_x)) * sqrt(sum(center_y * center_y));
|
||||
num / denom
|
||||
}
|
||||
|
||||
|
||||
select myCov(1,2);
|
||||
Reference in New Issue
Block a user