MCPcopy Create free account
hub / github.com/cel-expr/cel-go / absInt

Function absInt

ext/math.go:702–711  ·  view source on GitHub ↗
(val ref.Val)

Source from the content-addressed store, hash-verified

700}
701
702func absInt(val ref.Val) ref.Val {
703 v := int64(val.(types.Int))
704 if v == math.MinInt64 {
705 return errIntOverflow
706 }
707 if v >= 0 {
708 return val
709 }
710 return -types.Int(v)
711}
712
713func sign(val ref.Val) ref.Val {
714 switch v := val.(type) {

Callers

nothing calls this directly

Calls 1

IntTypeAlias · 0.92

Tested by

no test coverage detected