in reply to Re: long integer to hexadecimal conversion
in thread long integer to hexadecimal conversion
I wanted to say the same thing, but I'm late, I guess:
use bigint; my $n = 123456789123456; my ($h, $d); while ($n > 0) { $d = $n % 16; $n /= 16; $h .= sprintf "%x",$d; } print scalar reverse $h;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: long integer to hexadecimal conversion
by Joost (Canon) on Oct 01, 2009 at 12:38 UTC | |
by kikuchiyo (Hermit) on Oct 01, 2009 at 12:58 UTC | |
by perl_fan (Novice) on Oct 05, 2009 at 07:24 UTC | |
Re^3: long integer to hexadecimal conversion
by perl_fan (Novice) on Oct 05, 2009 at 07:29 UTC |
In Section
Seekers of Perl Wisdom