MCPcopy Create free account
hub / github.com/brimdata/super / Call

Method Call

runtime/vam/expr/function/math.go:16–28  ·  view source on GitHub ↗
(args ...vector.Any)

Source from the content-addressed store, hash-verified

14}
15
16func (a *Abs) Call(args ...vector.Any) vector.Any {
17 if vec, ok := expr.CheckForNullThenError(args); ok {
18 return vec
19 }
20 vec := vector.Under(args[0])
21 switch id := vec.Type().ID(); {
22 case super.IsUnsigned(id):
23 return vec
24 case super.IsSigned(id) || super.IsFloat(id):
25 return a.abs(vec)
26 }
27 return vector.NewWrappedError(a.sctx, "abs: not a number", vec)
28}
29
30func (a *Abs) abs(vec vector.Any) vector.Any {
31 switch vec := vec.(type) {

Callers

nothing calls this directly

Calls 9

absMethod · 0.95
CheckForNullThenErrorFunction · 0.92
UnderFunction · 0.92
IsUnsignedFunction · 0.92
IsSignedFunction · 0.92
IsFloatFunction · 0.92
NewWrappedErrorFunction · 0.92
IDMethod · 0.65
TypeMethod · 0.65

Tested by

no test coverage detected