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

Method ceil

runtime/vam/expr/function/math.go:85–103  ·  view source on GitHub ↗
(vec vector.Any)

Source from the content-addressed store, hash-verified

83}
84
85func (c *Ceil) ceil(vec vector.Any) vector.Any {
86 switch vec := vec.(type) {
87 case *vector.Const:
88 v := math.Ceil(vector.FloatValue(vec, 0))
89 return vector.NewConstFloat(vec.Type(), v, vec.Len())
90 case *vector.View:
91 return vector.Pick(c.ceil(vec.Any), vec.Index)
92 case *vector.Dict:
93 return vector.NewDict(c.ceil(vec.Any), vec.Index, vec.Counts)
94 case *vector.Float:
95 var floats []float64
96 for _, v := range vec.Values {
97 floats = append(floats, math.Ceil(v))
98 }
99 return vector.NewFloat(vec.Type(), floats)
100 default:
101 panic(vec)
102 }
103}
104
105type Floor struct {
106 sctx *super.Context

Callers 1

CallMethod · 0.95

Calls 7

FloatValueFunction · 0.92
NewConstFloatFunction · 0.92
PickFunction · 0.92
NewDictFunction · 0.92
NewFloatFunction · 0.92
TypeMethod · 0.65
LenMethod · 0.65

Tested by

no test coverage detected