static DataNode Clamp(DataCommand input) { var args = input.EvalAll(); float f1 = args.Number(1), f2 = args.Number(2), f3 = args.Number(3); return(new DataAtom(f1 > f3 ? f3 : f1 < f2 ? f1 : f2)); }
static DataNode Add(DataCommand input) { var args = input.EvalAll(); if (args.Node(1).Type == DataType.INT && args.Node(2).Type == DataType.INT) { return(new DataAtom(args.Int(1) + args.Int(2))); } return(new DataAtom(args.Number(1) + args.Number(2))); }
static DataNode Divide(DataCommand input) { var args = input.EvalAll(); return(new DataAtom(args.Number(1) / args.Number(2))); }
static DataNode AppendStr(DataCommand input) { var args = input.EvalAll(); return(new DataAtom(args.String(1) + args.String(2))); }
static DataNode BitAnd(DataCommand input) { var args = input.EvalAll(); return(new DataAtom(args.Int(1) & args.Int(2))); }
static DataNode AddEq(DataCommand input) { var args = input.EvalAll(); return(new DataAtom(args.Number(1) + args.Number(2))); }
static DataNode Abs(DataCommand input) { var args = input.EvalAll(); return(new DataAtom(Math.Abs(args.Number(1)))); }
static DataNode Lt(DataCommand input) { var args = input.EvalAll(); return(new DataAtom(args.Number(1) < args.Number(2) ? 1 : 0)); }
static DataNode Eq(DataCommand input) { var args = input.EvalAll(); return(new DataAtom(args.Node(1) == args.Node(2) ? 1 : 0)); }