private Thing Cdiv(String methodName, Thing[] args, Evaller evaller, Framelike frame, Syntax src) throws FisherException { checkNumberOfArgs(1, 1, methodName, args, evaller, frame, src); Thing m = args[0]; if (m instanceof IntTh) { IntTh im = (IntTh) m; return IntTh.of(this.value / im.value); } else if (m instanceof FloatTh) { FloatTh fth = (FloatTh) m; return FloatTh.of((long) (this.value / fth.value)); } else { Doom.runtime("Can't divide " + this + " idiv " + m, src, m); return null; } }
private Thing Cplus(String methodName, Thing[] args, Evaller evaller, Framelike frame, Syntax src) throws FisherException { checkNumberOfArgs(1, 1, methodName, args, evaller, frame, src); Thing m = args[0]; if (m instanceof IntTh) { IntTh im = (IntTh) m; return IntTh.of(im.value + this.value); } else if (m instanceof FloatTh) { FloatTh fth = (FloatTh) m; return FloatTh.of(fth.value + this.value); } else if (m instanceof StringTh) { StringTh sth = (StringTh) m; return StringTh.of(this.value + sth.value); } else { Doom.runtime("Can't add " + this + "+" + m, src, m); return null; } }