On Dec 26, 2006, at 10:59 AM, karlos wrote: Tdef(\test,{ so you have 0100 & 0000 = 0 0100 & 0001 = 0 0100 & 0010 = 0 0100 & 0011 = 0 0100 & 0100 = 4 0100 & 0101 = 4 0100 & 0110 = 4 0100 & 0111 = 4 What was the desired output? //then, as someone suggested, I used the 2^n to look for each bit IIRC bitwise operators work only on integers, but the result of ** is always a float. (2**2).dump Float 4.0 40100000 00000000 4 So you should do (2**i).asInteger or, more efficient, (1 << i) which is a bitwise shift. 8.do({ |i| (1 << i).postln }); 1 2 4 8 16 32 64 128 hjh : H. James Harkins : jamshark70@xxxxxxxxxxxxxxxxx : http://www.dewdrop-world.net .::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..: "Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal." -- Whitman |