(args []super.Value)
| 52 | } |
| 53 | |
| 54 | func (f *Floor) Call(args []super.Value) super.Value { |
| 55 | val := args[0] |
| 56 | switch id := val.Type().ID(); { |
| 57 | case super.IsUnsigned(id) || super.IsSigned(id): |
| 58 | return val |
| 59 | case super.IsFloat(id): |
| 60 | return super.NewFloat(val.Type(), math.Floor(val.Float())) |
| 61 | } |
| 62 | return f.sctx.WrapError("floor: not a number", val) |
| 63 | } |
| 64 | |
| 65 | type Log struct { |
| 66 | sctx *super.Context |