Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 imbibing at the Monastery: (3)
As of 2024-04-26 03:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found