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

Method Call

runtime/sam/expr/function/math.go:137–151  ·  view source on GitHub ↗
(args []super.Value)

Source from the content-addressed store, hash-verified

135}
136
137func (r *Round) Call(args []super.Value) super.Value {
138 val := args[0]
139 switch id := val.Type().ID(); {
140 case id == super.IDNull:
141 return val
142 case super.IsUnsigned(id) || super.IsSigned(id):
143 return val
144 case super.IsFloat(id):
145 if val.IsNull() {
146 return val
147 }
148 return super.NewFloat(val.Type(), math.Round(val.Float()))
149 }
150 return r.sctx.WrapError("round: not a number", val)
151}
152
153type Pow struct {
154 sctx *super.Context

Callers

nothing calls this directly

Calls 9

IsUnsignedFunction · 0.92
IsSignedFunction · 0.92
IsFloatFunction · 0.92
NewFloatFunction · 0.92
IsNullMethod · 0.80
FloatMethod · 0.80
WrapErrorMethod · 0.80
IDMethod · 0.65
TypeMethod · 0.65

Tested by

no test coverage detected