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

Function constToNumeric

runtime/vam/expr/agg/mathfunc.go:174–183  ·  view source on GitHub ↗
(vec *vector.Const)

Source from the content-addressed store, hash-verified

172}
173
174func constToNumeric[T numeric](vec *vector.Const) T {
175 switch id := vec.Type().ID(); {
176 case super.IsUnsigned(id):
177 return T(vector.UintValue(vec, 0))
178 case super.IsSigned(id):
179 return T(vector.IntValue(vec, 0))
180 default:
181 return T(vector.FloatValue(vec, 0))
182 }
183}
184
185func minString(state string, vec vector.Any) string {
186 if vec, ok := vec.(*vector.Const); ok {

Callers

nothing calls this directly

Calls 7

IsUnsignedFunction · 0.92
UintValueFunction · 0.92
IsSignedFunction · 0.92
IntValueFunction · 0.92
FloatValueFunction · 0.92
IDMethod · 0.65
TypeMethod · 0.65

Tested by

no test coverage detected