Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I do 64-bit arithmetic in Perl?

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?
like image 874
Alphaneo Avatar asked Dec 08 '09 02:12

Alphaneo


1 Answers

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

like image 143
Alan Haggai Alavi Avatar answered Sep 27 '22 23:09

Alan Haggai Alavi