Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Very Large Hex Combinations

by Anonymous Monk
on Aug 04, 2005 at 14:50 UTC ( #480853=note: print w/ replies, xml ) Need Help??


in reply to Very Large Hex Combinations

If you have a 64-bit Perl, a simple

for my $x (0 .. 0x7FFFFFFFFFFFFFFF) { printf "%016x\n", $x }
will keep you occupied for 168351 years if you can print a billion lines per second.

For a 32 bit Perl, use something like:

for my $x1 (0 .. 0x7F) { for my $x2 (0 .. 0xFFFFFFF) { for my $x3 (0 .. 0xFFFFFFF) { printf "%02x%07x%07x", $x1, $x2, $x3; } } }
for the same range and running time.


Comment on Re: Very Large Hex Combinations
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://480853]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2014-09-16 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (36 votes), past polls