diff --git a/newrpl/lib-104-solvers.c b/newrpl/lib-104-solvers.c index c254a47..2a2d267 100644 --- a/newrpl/lib-104-solvers.c +++ b/newrpl/lib-104-solvers.c @@ -26,7 +26,8 @@ ERR(INVALIDLISTOFVARS,2), \ ERR(INVALIDVARRANGE,3), \ ERR(REALVALUEDFUNCTIONSONLY,4), \ - ERR(TRYDIFFERENTRANGE,5) + ERR(TRYDIFFERENTRANGE,5), \ + ERR(INVALIDSYMBFUNCTION,6) // LIST OF COMMANDS EXPORTED, // INCLUDING INFORMATION FOR SYMBOLIC COMPILER @@ -151,6 +152,41 @@ case NUMINT: return; } + // ADD CHECKS TO SEE IF THE SYMBOLIC IS VALID + if(ISSYMBOLIC(*rplPeekData(4))) { + if(rplSymbMainOperator(rplPeekData(4))!=CMD_EQUATIONOPERATOR) { + rplError(ERR_INVALIDSYMBFUNCTION); + return; + } + WORDPTR leftpart=rplSymbMainOperatorPTR(rplPeekData(4))+1; + if(ISSYMBOLIC(*leftpart)) { + if(rplSymbMainOperator(leftpart)!=CMD_OVR_FUNCEVAL) { + rplError(ERR_INVALIDSYMBFUNCTION); + return; + } + // COUNT NUMBER OF ARGUMENTS + WORDPTR end=rplSkipOb(leftpart); + BINT nargs=0; + leftpart=rplSymbMainOperatorPTR(leftpart)+1; + while(leftpart" @#name allroots_rules { '√.xX:→XROOT(ABS(.xX),2)*c{1,-1}' -'.xX^(1/.iN):→XROOT(ABS(.xX),.iN)*е^(ARG(.xX)/.iN*і+∡360°/.iN*RANGE(1,.iN,1))' +'.xX^(1/.iN):→XROOT(ABS(.xX),.iN)*е^(і*(ARG(.xX)/.iN+∡360°/.iN*RANGE(1,.iN,1)))' }