in reply to Re: Bitwise operators
in thread Bitwise operators
I just now read this earlier post of yours.
print "$value & 1", "$Value & 2", "$value & 4";
The problem you're having is that you can only interpolate a certain amount within strings, and doing bit-wise arithmetic is a little too much.
You could do this if you used printf like so:printf "%d, %d, %d, ", $value & 1, $value & 2, $value & 4;
And you could even convert to one or zero values by applying the appropriate shifts:
printf "%d, %d, %d, ", ($value & 1), ($value & 2) >> 1, ($value & 4) > +> 2;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Bitwise operators
by thevoid (Scribe) on Dec 25, 2006 at 22:14 UTC |