(it iter.Seq[ast.Constant])
| 1357 | } |
| 1358 | |
| 1359 | func evalMax(it iter.Seq[ast.Constant]) (ast.Constant, error) { |
| 1360 | max := int64(math.MinInt64) |
| 1361 | for c := range it { |
| 1362 | num, err := c.NumberValue() |
| 1363 | if err != nil { |
| 1364 | return ast.Constant{}, err |
| 1365 | } |
| 1366 | if num > max { |
| 1367 | max = num |
| 1368 | } |
| 1369 | } |
| 1370 | return ast.Number(max), nil |
| 1371 | } |
| 1372 | |
| 1373 | func evalFloatMax(it iter.Seq[ast.Constant]) (ast.Constant, error) { |
| 1374 | max := -1 * math.MaxFloat64 |
no test coverage detected