performs a float and subsequent decimal.Decimal conversion on inputs, and iterates through a and b executing the mathmetical operation f
(a interface{}, b []interface{}, f func(d1, d2 decimal.Decimal) decimal.Decimal)
| 176 | // performs a float and subsequent decimal.Decimal conversion on inputs, |
| 177 | // and iterates through a and b executing the mathmetical operation f |
| 178 | func execDecimalOp(a interface{}, b []interface{}, f func(d1, d2 decimal.Decimal) decimal.Decimal) float64 { |
| 179 | prt := decimal.NewFromFloat(toFloat64(a)) |
| 180 | for _, x := range b { |
| 181 | dx := decimal.NewFromFloat(toFloat64(x)) |
| 182 | prt = f(prt, dx) |
| 183 | } |
| 184 | rslt, _ := prt.Float64() |
| 185 | return rslt |
| 186 | } |
no test coverage detected
searching dependent graphs…