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

Method Call

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

Source from the content-addressed store, hash-verified

67}
68
69func (l *Log) Call(args []super.Value) super.Value {
70 if args[0].IsError() {
71 return args[0]
72 }
73 if args[0].IsNull() {
74 return super.Null
75 }
76 x, ok := coerce.ToFloat(args[0], super.TypeFloat64)
77 if !ok {
78 return l.sctx.WrapError("log: not a number", args[0])
79 }
80 if x <= 0 {
81 return l.sctx.WrapError("log: illegal argument", args[0])
82 }
83 return super.NewFloat64(math.Log(x))
84}
85
86type reducer struct {
87 sctx *super.Context

Callers

nothing calls this directly

Calls 5

ToFloatFunction · 0.92
NewFloat64Function · 0.92
IsErrorMethod · 0.80
IsNullMethod · 0.80
WrapErrorMethod · 0.80

Tested by

no test coverage detected