floats/scalar: new package containing non-vector functions from floats

This commit is contained in:
Dan Kortschak
2020-08-04 14:03:00 +09:30
parent 48235867ac
commit da72779e7a
101 changed files with 965 additions and 745 deletions

View File

@@ -8,7 +8,7 @@ import (
"math"
"testing"
"gonum.org/v1/gonum/floats"
"gonum.org/v1/gonum/floats/scalar"
)
func TestAdd(t *testing.T) {
@@ -227,7 +227,7 @@ func TestCos(t *testing.T) {
t.Run("", func(t *testing.T) {
tol := 1e-14
got := Cos(test.v1, test.v2)
if !floats.EqualWithinAbs(got, test.want, tol) {
if !scalar.EqualWithinAbs(got, test.want, tol) {
t.Fatalf("cos(%v, %v)= %v, want %v",
test.v1, test.v2, got, test.want,
)