in reply to Convert Hex to BigInt
$x= "0x0081def509be"; use Math::BigInt; sub bighex{ my $x = shift; return Math::BigInt->new(hex($x)) if 8 > length $x; return (bighex(substr $x,0,-4)<<16) + hex substr($x,-4); } $d = bighex($x); print "$d\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Convert Hex to BigInt
by gargsan (Initiate) on Feb 14, 2002 at 16:34 UTC |