[Date Index] [Thread Index] [Author Index]
Comparison Error. Is there an overall fix?
I'm having trouble with comparisons, see below: In:= x=0.9; y=10; In:= (1-x)y Out=1. The above obviously evaluates to 1. In:= (1-x)y <1 Out= True The above gives the wrong answer. In:= (1-x)y<1. Out= False This gives the right answer, notice the decimal point after the 1. Do I have to remember to put 1. on the right hand side each time? What if, on occasion, the left hand side turns out to be "1", instead of "1." Doing N is not a global fix, because sometimes my expression can be 0. In this case, N is not "0.", it is just "0". So, the N to both sides won't always work. Is there some global way to correct for this kind of stuff???? Thanks in advance, Chris