Maybe everybody knows this, but I learned it the hard way: Javascript treats y=="" and y==0 as being the same.
I have a little program that solves nonlinear equations online, see:
The evaluation function returns "" if an equation cannot be evaluated for a given x, otherwise, it returns the result of the evaluation, which could be zero (0).
Lo and behold, when it returned 0, it triggered the (y==""
test, which stops the program and outputs a message.
I found that you must test:
if ((y==""
&& (isNaN(parseInt
)))
Hope this helps somebody. Regards, Helmt
I have a little program that solves nonlinear equations online, see:
The evaluation function returns "" if an equation cannot be evaluated for a given x, otherwise, it returns the result of the evaluation, which could be zero (0).
Lo and behold, when it returned 0, it triggered the (y==""
I found that you must test:
if ((y==""
Hope this helps somebody. Regards, Helmt