Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Very Large Hex Combinations

by TedYoung (Deacon)
on Aug 04, 2005 at 14:45 UTC ( #480851=note: print w/ replies, xml ) Need Help??


in reply to Very Large Hex Combinations

This should get you started...

use strict; use warnings; use Math::BigInt; my $x = Math::BigInt->new; while (++$x) { # Runs forever print uc substr $x->as_hex, 2; }

The substr is needed because as_hex puts 0x before the number which you didn't want. And the uc is pretty self-explanitory.

Update: The key point here is that the op wants to go above 2 ** 32 or 2 ** 64. In those cases, I could not get sprintf "%X" to work (without having to do lots of shifting).

Ted Young

($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)


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://480851]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (13)
As of 2015-07-28 18:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls