Hi,

I am trying to find out if using an AND instead of an OR condition is more efficient.

Say I have a check

if(.NOT. (a > 0 and a < 10 and b > 0 and b < 10))then call add else call subtract end if

Is this better than

if(a<0 or a > 10 or b < 0 or b > 10) then call add else call subtract endif

For an AND condition, it is enough if one of the condition is FALSE, whereas for the OR it has to check all the conditions. Is this correct?

I ask since I have a grid of 128^{3} cells and I need to do the above check for each cell. I am not sure if this takes a lot of time, but I would like to optimize it if possible.

Thanks in advance.