18.08.2012, 10:42
oh, i see my mistake. i dont know why i assumed the values as bits, and accidently thought ahead w/o reading the variable names: teammemberS indeed implicits an integer, my wrong.
oh, yes, i tested it - but only with bits. when:
and the operator | ,aka "logical and", outputs a 1 if ANY of those bits equals 1, then
equals
while, with integers:
a|b|c equals 16|128|51 //and HERE i stopped using my brain. i feel forced to explain my mistake...
the fail output of my suggestion would have been
^ thats 128+32+16+2+1=179, or 16+128+(51-16=35)=179.
the extra 35 is made of the differenting 3/4 bits in 51: 4 bits in 51 | 1 bit in 16, are adding 3 bits only:
watch the missing bit #4 (valued 16), its gone!
i guess i will ask before i give rushed answers, especially when i dont get the problem right - sorry for causing confusion.
for those who didnt expect an excuse: its not my fault, its the integers'...
@******: "yes", and "yes". failed nevertheless. how/why? an honest answer would force you to censor it ^^
@FalconX: yes, this operator gets used in my fingerprint include/filterscript in my signature, its working excellent in the proper environment ^^
oh, yes, i tested it - but only with bits. when:
Код:
a=0xb1; b=0xb0; c=0xb1;
Код:
if (0 < a|b|c)
Код:
if (0 < 1) //but equals 0 when a=0, b=0, c=0, 0and0and0=0...
Код:
a=16; b=128; c=51;
Код:
a=0xb 00010000 //16 b=0xb 10000000 //128 c=0xb 00110011 //51
Код:
result=0xb 10110011 //179. this number appears from thin air, right? it doesnt:
the extra 35 is made of the differenting 3/4 bits in 51: 4 bits in 51 | 1 bit in 16, are adding 3 bits only:
Код:
(51-16=35) //equals 0xb 001 1 0011 //51 - 0xb 000 1 0000 //16 = 0xb 001 0 0011 //35
i guess i will ask before i give rushed answers, especially when i dont get the problem right - sorry for causing confusion.
for those who didnt expect an excuse: its not my fault, its the integers'...
@******: "yes", and "yes". failed nevertheless. how/why? an honest answer would force you to censor it ^^
@FalconX: yes, this operator gets used in my fingerprint include/filterscript in my signature, its working excellent in the proper environment ^^