Fix bug in math.spread() SQL function

This commit is contained in:
Tobie Morgan Hitchcock 2018-04-29 14:42:49 +01:00
parent 86b81c469e
commit 05f8b6ad6b
2 changed files with 2 additions and 2 deletions

View file

@ -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() {

View file

@ -36,6 +36,6 @@ func Spread(vals []float64) float64 {
}
}
return max - min
return (max - min) - 1
}