Perl – How to do 64-bit arithmetic in Perl

64-bitperlsigned

I am a perl newbie,

Can I simply use 64-bit arithmetic in Perl?

For example

$operand1 = 0xFFFFFFFFFFFF;   # 48 bit value
$operand2 = 0xFFFFFFFFFFFF;   # 48 bit value

$Result = $operand1 * $operand2;
  • I am basically looking for a
    replacement for the int64_t in perl.
  • Is there any way to mention, if the
    variable is signed or unsigned?

Best Answer

Yes, however you need to have Perl compiled with 64-bit support.