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

Function evalFloatMax

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

Source from the content-addressed store, hash-verified

1371}
1372
1373func evalFloatMax(it iter.Seq[ast.Constant]) (ast.Constant, error) {
1374 max := -1 * math.MaxFloat64
1375 for c := range it {
1376 num, err := c.Float64Value()
1377 if err != nil {
1378 return ast.Constant{}, err
1379 }
1380 if num > max {
1381 max = num
1382 }
1383 }
1384 return ast.Float64(max), nil
1385}
1386
1387func evalMin(it iter.Seq[ast.Constant]) (ast.Constant, error) {
1388 min := int64(math.MaxInt64)

Callers 2

EvalApplyFnFunction · 0.85
EvalReduceFnFunction · 0.85

Calls 2

Float64Function · 0.92
Float64ValueMethod · 0.80

Tested by

no test coverage detected