|
@@ -149,6 +149,12 @@ public class LispEval {
|
|
|
}
|
|
|
return LispElement.generate(Math.abs(le.toNumber()));
|
|
|
});
|
|
|
+ operators.put("cbrt", (op, lisp) -> {
|
|
|
+ if(lisp.size() != 1) {
|
|
|
+ throw new LispError(LispError.ERR_NUM_ARG);
|
|
|
+ }
|
|
|
+ return LispElement.generate(Math.cbrt(LispElement.getElement(lisp.car()).toNumber()));
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private Object lispElt = null;
|