This is an example how to print the Bit position of a value.
1 2 3 4 5 6 7 8 9 |
use strict; printBits(5); sub printBits { my $count=0; for(reverse split//,sprintf("%b",$_[0])) {print "Bit position: @{[++$count]}. value @{[1<<($count-1)]}$/"x!!$_;} } |
And we see for 5 we get position 1 and 3, and the values 1 and 4 result at 5.
1 2 3 |
sh-4.2# perl main.pl Bit position: 1. value 1 Bit position: 3. value 4 |
Hello, i believe that i noticed you visited my web site so i came
to return the want?.I’m trying to in finding issues to enhance my website!I assume its good enough to
make use of some of your concepts!!
Hello, i think that i saw you visited my website so i came to “return the
favor”.I am trying to find things to enhance
my website!I suppose its ok to use a few of your ideas!!
This is very interesting, You’re a very skilled blogger. I have joined your feed and look forward to seeking more of your magnificent post.
Also, I’ve shared your site in my social networks!