<?xml version="1.0" encoding="windows-1252"?>
<node id="798585" title="long integer to hexadecimal conversion" created="2009-10-01 06:08:56" updated="2009-10-01 06:08:56">
<type id="115">
perlquestion</type>
<author id="636295">
perl_fan</author>
<data>
<field name="doctext">
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'   

&lt;code&gt;
#!/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";
&lt;/code&gt;

The output

&lt;code&gt;
&gt; ./t.pl
value of 3143230627 : bb59e4a3
value of 123143230627 : ffffffff
&lt;/code&gt;

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</field>
</data>
</node>
