in reply to Turning very larger numbers into an array of bits
Rather than an array you might be able to use vec.
johngg@shiraz:~/perl > perl -Mstrict -Mwarnings -E ' my $vec; vec( $vec, 0, 8 ) = 57; say qq{Bit $_: }, vec( $vec, $_, 1 ) ? q{set} : q{not set} for 0 .. 7;' Bit 0: set Bit 1: not set Bit 2: not set Bit 3: set Bit 4: set Bit 5: set Bit 6: not set Bit 7: not set
I hope this is helpful.
Update: Note that vec can vector sizes up to 64 bits on Perl compiled for 64-bit environments. This doesn't satisfy your 80-bit requirement unfortunately.
Cheers,
JohnGG
|
|---|