(vec vector.Any)
| 83 | } |
| 84 | |
| 85 | func (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 | |
| 105 | type Floor struct { |
| 106 | sctx *super.Context |
no test coverage detected