Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Helter's scratchpad

by Helter (Chaplain)
on Jun 04, 2004 at 20:11 UTC ( [id://361192]=scratchpad: print w/replies, xml ) Need Help??

The code I have now:
sub bitextr { my $bitstring = shift; my $bitnum1 = shift; my $bitnum2; #Swap the indices if they are high-low if( $bitnum1 > $bitnum2 ) { ($bitnum1, $bitnum2 ) = ($bitnum2, $bitnum1 ); } my $size = ($bitnum2-$bitnum1+1); print STDERR "size is $size\n"; my $mask = ("1"x$size); print STDERR "mask is $mask\n"; $mask = unpack( "N*", pack( "B$size", $mask )); print STDERR "mask is $mask\n"; return (($bitstring >> $bitnum1) & ($mask)); }
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-03-29 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found