mirror of
https://github.com/gonum/gonum.git
synced 2025-10-07 08:01:20 +08:00
floats/scalar: new package containing non-vector functions from floats
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"gonum.org/v1/gonum/floats"
|
||||
"gonum.org/v1/gonum/floats/scalar"
|
||||
)
|
||||
|
||||
// intSosMatch returns true if the two slices of slices are equal.
|
||||
@@ -97,7 +97,7 @@ func TestBinomial(t *testing.T) {
|
||||
func TestGeneralizedBinomial(t *testing.T) {
|
||||
for cas, test := range binomialTests {
|
||||
ans := GeneralizedBinomial(float64(test.n), float64(test.k))
|
||||
if !floats.EqualWithinAbsOrRel(ans, float64(test.ans), 1e-14, 1e-14) {
|
||||
if !scalar.EqualWithinAbsOrRel(ans, float64(test.ans), 1e-14, 1e-14) {
|
||||
t.Errorf("Case %v: Binomial mismatch. Got %v, want %v.", cas, ans, test.ans)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user