In C/C++ (and Java?) James logical "and" would be: if ((x) && (y)) though maybe if (x && y) would work too. On 17 Apr 2014, at 16:52, James Cloos wrote:
"WDS" == Warren D Smith <warren.wds@gmail.com> writes:
WDS> If x and y both are unsigned integers, and we want to tell whether WDS> (x>0 and y>0), WDS> then how can we do it?
In a language with a logical AND,
x AND y is true iff both are > 0.
In amd64 assembly, this seems best:
xor %eax,%eax test %rsi,%rdi setne %al retq
In arm assembly, that looks like:
tst r0, r1 moveq r0, #0 movne r0, #1 bx lr
-JimC -- James Cloos <cloos@jhcloos.com> OpenPGP: 1024D/ED7DAEA6
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
The meaning and purpose of life is to give life purpose and meaning. The instigation of violence indicates a lack of spirituality.