C# doesn't use
(int)1
as
true
, so you will need to use
(x==y && y==1)
see the link below, but to make a long story short, the C# compiler tends
to be more like a binary child, it likes things in strong typed format,
as such if there is any disention inside its ranks, it will just throw a compilation error.
just try something like
int a = Math.Round(Math.PI,0);
which throws Error:
Cannot implicitly convert type 'double' to 'int'.<br />An explicit conversion exists (are you missing a cast?)
and can be resolved by
int a = (int)Math.Round(Math.PI,0);
but you cannot use:
<br /> int a = 2, b = 3;<br /> if((bool)(a)&&(bool)(b)){}
alternativly you can restructure to just use bools
<br /> bool bx;
or make an operator
<br />BinaryAnd(int x,int y)<br />{<br /> if(x==1&&y==1){return true;}<br /> return false;<br />}
you should say more about how you intend to use it,
because there are lots of ways to get the same result.
clicky...hope it helps, my C is a bit rusty, it's been a couple of years. [confused]