stat/distmv,unit: fix ineffectual assignments
Many are left, either because the code is not idiomatic and derived from
other implementations or there is a reason behind the assignment.
MODIFY
stat/distmv/studentst_test.go
stat/distmv/studentst_test.go
@@ -163,6 +163,9 @@ func TestStudentsTConditional(t *testing.T) {
}
sUp, ok := s.ConditionStudentsT(test.idx, test.value, src)
+ if !ok {
+ t.Error("unexpected failure of ConditionStudentsT")
+ }
// Compute the other values by hand the inefficient way to compare
newNu := test.nu + float64(len(test.idx))

MODIFY
unit/unit_test.go
unit/unit_test.go
@@ -248,19 +248,21 @@ func (u *UnitMap) Mul(aU UnitMapper) *UnitMap {
return u
}
+var sink float64
+
func BenchmarkAddFloat(b *testing.B) {
- a := 0.0
+ sink = 0
c := 10.0
for i := 0; i < b.N; i++ {
- a += c
+ sink += c
}
}
func BenchmarkMulFloat(b *testing.B) {
- a := 0.0
+ sink = 0
c := 10.0
for i := 0; i < b.N; i++ {
- a *= c
+ sink *= c
}
}

stat/distmv,unit: fix ineffectual assignments

Many are left, either because the code is not idiomatic and derived from
other implementations or there is a reason behind the assignment.