(*) now evaluates to 1 instead of 0

I have no idea if this matters or if it's in the spec or anything like
that.
master
Jordan Orelli 12 years ago
parent e31816c22f
commit 93c86871da

@ -16,7 +16,7 @@ type accumulator struct {
func (a *accumulator) total(vals []interface{}) (interface{}, error) {
if vals == nil || len(vals) == 0 {
return int64(0), nil
return a.acc, nil
}
switch v := vals[0].(type) {

@ -63,6 +63,8 @@ func multiplication(vals []interface{}) (interface{}, error) {
intFn: func(left, right int64) (int64, error) {
return left * right, nil
},
acc: 1,
accf: 1.0,
}
return a.total(vals)
}

Loading…
Cancel
Save