Fix bug in math.spread() SQL function
This commit is contained in:
parent
86b81c469e
commit
05f8b6ad6b
2 changed files with 2 additions and 2 deletions
|
@ -227,7 +227,7 @@ func TestMath(t *testing.T) {
|
|||
res, _ = Run(context.Background(), "math.spread", 10)
|
||||
So(res, ShouldEqual, 0)
|
||||
res, _ = Run(context.Background(), "math.spread", test)
|
||||
So(res, ShouldEqual, 4.5)
|
||||
So(res, ShouldEqual, 3.5)
|
||||
})
|
||||
|
||||
Convey("math.sqrt() works properly", t, func() {
|
||||
|
|
|
@ -36,6 +36,6 @@ func Spread(vals []float64) float64 {
|
|||
}
|
||||
}
|
||||
|
||||
return max - min
|
||||
return (max - min) - 1
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue