We are having the same problem described here
http://groups.google.com/group/jep-users/browse_thread/thread/8934dc53031545a6#
We want to be able to evaluate an expression like this
if(IsNull(x), y, x)
but jep throws an exception if x is null. If we set
FastEvaluator.setTrapNullValues(false) then we get an exception in the
standard functions (even though we aren't using them in our
expression)
com.singularsys.jep.functions.IllegalParameterException: *: lllegal
parameters null, 1000.0(Double)
at com.singularsys.jep.functions.Multiply.mul(Unknown Source)
at com.singularsys.jep.functions.Multiply.eval(Unknown Source)
at com.singularsys.jep.standard.FastEvaluator.visitFun(Unknown
Source)
at com.singularsys.jep.standard.FastEvaluator.nodeAccept(Unknown
Source)
at com.singularsys.jep.standard.FastEvaluator.evaluate(Unknown
Source)
at com.singularsys.jep.Jep.evaluate(Unknown Source)
at com.singularsys.jep.Jep.evaluateD(Unknown Source)
Is there a way to do this?
Thanks,
Trevor
It looks like you are evaluating some equation multiplying a variable
by 1000, the variables looks like it has a null value. I'd need a few
more details to see whats going on.
Rich
On Feb 1, 10:06 am, Trevor <trevordkra...@gmail.com> wrote:
> Hello,
>
> We are having the same problem described here
>
> http://groups.google.com/group/jep-users/browse_thread/thread/8934dc5...
Note that this error is only throw when calling jep.evaluateD().
Trevor
The solution is to add IsNull to the function table with
jep.addFunction("isNull", new IsNull());
You may also want to turn off allowing undeclared variables and
implicit multiplication if you do not use them.
Hope this is helpful,
Nathan Funk