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

Method Call

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

Source from the content-addressed store, hash-verified

175}
176
177func (s *Sqrt) Call(args []super.Value) super.Value {
178 val := args[0].Under()
179 if val.IsNull() {
180 return super.Null
181 }
182 if !super.IsNumber(val.Type().ID()) {
183 return s.sctx.WrapError("sqrt: number argument required", val)
184 }
185 x, ok := coerce.ToFloat(val, super.TypeFloat64)
186 if !ok {
187 return s.sctx.WrapError("sqrt: not a number", val)
188 }
189 return super.NewFloat64(math.Sqrt(x))
190}

Callers

nothing calls this directly

Calls 8

IsNumberFunction · 0.92
ToFloatFunction · 0.92
NewFloat64Function · 0.92
UnderMethod · 0.80
IsNullMethod · 0.80
WrapErrorMethod · 0.80
IDMethod · 0.65
TypeMethod · 0.65

Tested by

no test coverage detected