I am writing an app in Perl that requires long data type instead of integers. How can I achieve this. For example;
my $num = sprintf('%ld', 27823221234);
print $num;
The output is not a long, but an integer.
Your options are:
update: ah, you can also use floats instead of integers:
printf("%.0f", 2**50)
IIRC, on most current architectures, floats can represent integers up to 2**54-1 precisely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With