MCPcopy Index your code
hub / github.com/google/mangle / evalMax

Function evalMax

functional/functional.go:1359–1371  ·  view source on GitHub ↗
(it iter.Seq[ast.Constant])

Source from the content-addressed store, hash-verified

1357}
1358
1359func 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
1373func evalFloatMax(it iter.Seq[ast.Constant]) (ast.Constant, error) {
1374 max := -1 * math.MaxFloat64

Callers 2

EvalApplyFnFunction · 0.85
EvalReduceFnFunction · 0.85

Calls 2

NumberFunction · 0.92
NumberValueMethod · 0.80

Tested by

no test coverage detected