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

@@ -9,7 +9,7 @@ import (
"math"
"testing"
"gonum.org/v1/gonum/floats"
"gonum.org/v1/gonum/floats/scalar"
)
var formatTests = []struct {
@@ -473,5 +473,5 @@ func sameHyperdual(a, b Number, tol float64) bool {
func same(a, b, tol float64) bool {
return (math.IsNaN(a) && math.IsNaN(b)) ||
(floats.EqualWithinAbsOrRel(a, b, tol, tol) && math.Float64bits(a)&(1<<63) == math.Float64bits(b)&(1<<63))
(scalar.EqualWithinAbsOrRel(a, b, tol, tol) && math.Float64bits(a)&(1<<63) == math.Float64bits(b)&(1<<63))
}