perl_fan has asked for the wisdom of the Perl Monks concerning the following question:
Hello Gurus,
i have a long integer which i want to convert to hexadecimal. When i try to convert the integer to hexadecimal beyond certain digits, it gives the value as 'ffffff'
The output#!/usr/local/bin/perl $intval = 3143230627; $hexval = sprintf ("%x", $intval); printf "value of $intval : $hexval \n"; $intval = 123143230627; $hexval = sprintf ("%x", $intval); printf "value of $intval : $hexval \n";
any help will be appreciated. Note: would like to use inbuilt functions or modules, because any other module installation will be unacceptable to the project. cheers, M> ./t.pl value of 3143230627 : bb59e4a3 value of 123143230627 : ffffffff
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: long integer to hexadecimal conversion
by Joost (Canon) on Oct 01, 2009 at 10:49 UTC | |
by kikuchiyo (Hermit) on Oct 01, 2009 at 10:58 UTC | |
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 | |
by perl_fan (Novice) on Oct 05, 2009 at 07:29 UTC | |
Re: long integer to hexadecimal conversion
by Anonymous Monk on Oct 01, 2009 at 10:16 UTC | |
Re: long integer to hexadecimal conversion
by Bloodnok (Vicar) on Oct 01, 2009 at 10:16 UTC | |
by perl_fan (Novice) on Oct 01, 2009 at 10:27 UTC | |
by Marshall (Canon) on Oct 01, 2009 at 13:14 UTC |
Back to
Seekers of Perl Wisdom