Faster :Triple check or check with *
#5

Okay. you seem to miss the concept. If wanted thing is true, (BTW, by last post you could have understood that i meant > instead of copying my mistake) then one is called, so that
if(3>0 && 4>0) //will return true - YES. And effect is equal to next one.
else if(3<0 && 4<0) //will return false
if(3*4>0) - This too will be called, so both scripts check same thing. They pass only when x and y is both positive or negative making result positive. GOT IT? For you i can note that triple check means that the second example at worst does 3 checks in case of X and Y being < 0 :
if(X>0 && Y>0) - evaluates false and doesn't even go to Y.
if(X<0 && Y<0) - evaluates true with 2 checks.
Reply


Messages In This Thread
[Resolved?] float functions are faster than if() - by RSX - 12.09.2010, 15:02
Re: Faster :Triple check or check with * - by LarzI - 12.09.2010, 15:28
Re: [Resolved?] float functions are faster than if() - by RSX - 12.09.2010, 15:30
Re: Faster :Triple check or check with * - by LarzI - 12.09.2010, 15:34
Re: Faster :Triple check or check with * - by RSX - 12.09.2010, 15:41
Re: Faster :Triple check or check with * - by kc - 12.09.2010, 15:46
Re:[Resolved?] float functions are faster than if() - by RSX - 12.09.2010, 16:10

Forum Jump:


Users browsing this thread: 1 Guest(s)