MCPcopy Create free account
hub / github.com/google/mangle / evalMin

Function evalMin

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

Source from the content-addressed store, hash-verified

1385}
1386
1387func evalMin(it iter.Seq[ast.Constant]) (ast.Constant, error) {
1388 min := int64(math.MaxInt64)
1389 for c := range it {
1390 num, err := c.NumberValue()
1391 if err != nil {
1392 return ast.Constant{}, err
1393 }
1394 if num < min {
1395 min = num
1396 }
1397 }
1398 return ast.Number(min), nil
1399}
1400
1401func evalFloatMin(it iter.Seq[ast.Constant]) (ast.Constant, error) {
1402 min := math.MaxFloat64

Callers 2

EvalApplyFnFunction · 0.85
EvalReduceFnFunction · 0.85

Calls 2

NumberFunction · 0.92
NumberValueMethod · 0.80

Tested by

no test coverage detected