Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Negative in if statement #12
Argument a = new Argument("a");
var e = new Expression("if(a=6,-b,15)", a, b);
This works fine and returns result = -5.
then this takes a long time to execute the calculate() and then returns NaN instead of 15 as a is not equal to 6.
if however the expression is "if(a=6,b,15)" then this works fine and returns 15
Also expression = if(a=6,0-b,15)" works fine
Problem seems to be if you start with a negative sign in true condition part but your condition evaluates to false