diff --git a/util/fncs/math_test.go b/util/fncs/math_test.go index b3e57c04..dfdef0f4 100644 --- a/util/fncs/math_test.go +++ b/util/fncs/math_test.go @@ -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() { diff --git a/util/math/spread.go b/util/math/spread.go index 1de0bc2a..c0434041 100644 --- a/util/math/spread.go +++ b/util/math/spread.go @@ -36,6 +36,6 @@ func Spread(vals []float64) float64 { } } - return max - min + return (max - min) - 1 }