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

Method Eval

runtime/sam/expr/cast.go:94–100  ·  view source on GitHub ↗
(val super.Value)

Source from the content-addressed store, hash-verified

92}
93
94func (c *casterFloat) Eval(val super.Value) super.Value {
95 f, ok := coerce.ToFloat(val, c.typ)
96 if !ok {
97 return c.sctx.WrapError("cannot cast to "+sup.FormatType(c.typ), val)
98 }
99 return super.NewFloat(c.typ, f)
100}
101
102type casterIP struct {
103 sctx *super.Context

Callers

nothing calls this directly

Calls 4

ToFloatFunction · 0.92
FormatTypeFunction · 0.92
NewFloatFunction · 0.92
WrapErrorMethod · 0.80

Tested by

no test coverage detected