Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
So, can you create the 32 element array using vec or pack/unpack? I give up.@_ = (0, map -1<<$_ , reverse 0 .. 31); print unpack("B*",pack(N,$_)) . "\n" foreach @_; 00000000000000000000000000000000 10000000000000000000000000000000 11000000000000000000000000000000 11100000000000000000000000000000 11110000000000000000000000000000 11111000000000000000000000000000 11111100000000000000000000000000 11111110000000000000000000000000 11111111000000000000000000000000 11111111100000000000000000000000 11111111110000000000000000000000 11111111111000000000000000000000 11111111111100000000000000000000 11111111111110000000000000000000 11111111111111000000000000000000 11111111111111100000000000000000 11111111111111110000000000000000 11111111111111111000000000000000 11111111111111111100000000000000 11111111111111111110000000000000 11111111111111111111000000000000 11111111111111111111100000000000 11111111111111111111110000000000 11111111111111111111111000000000 11111111111111111111111100000000 11111111111111111111111110000000 11111111111111111111111111000000 11111111111111111111111111100000 11111111111111111111111111110000 11111111111111111111111111111000 11111111111111111111111111111100 11111111111111111111111111111110
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: vec vs pack/unpack
by shmem (Chancellor) on Jul 08, 2018 at 10:00 UTC | |
|
Re: vec vs pack/unpack
by johngg (Canon) on Jul 08, 2018 at 12:57 UTC | |
|
Re: vec vs pack/unpack
by KurtZ (Friar) on Jul 08, 2018 at 06:43 UTC |