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

Method Call

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

Source from the content-addressed store, hash-verified

107}
108
109func (f *Floor) Call(args ...vector.Any) vector.Any {
110 if vec, ok := expr.CheckForNullThenError(args); ok {
111 return vec
112 }
113 vec := vector.Under(args[0])
114 switch id := vec.Type().ID(); {
115 case super.IsFloat(id):
116 return f.floor(vec)
117 case super.IsNumber(id):
118 return vec
119 }
120 return vector.NewWrappedError(f.sctx, "floor: not a number", vec)
121}
122
123func (f *Floor) floor(vec vector.Any) vector.Any {
124 switch vec := vec.(type) {

Callers

nothing calls this directly

Calls 8

floorMethod · 0.95
CheckForNullThenErrorFunction · 0.92
UnderFunction · 0.92
IsFloatFunction · 0.92
IsNumberFunction · 0.92
NewWrappedErrorFunction · 0.92
IDMethod · 0.65
TypeMethod · 0.65

Tested by

no test coverage detected