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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is some code that illustrates some of how Perl behaves – derived from your example:
With a 64-bit Perl, this yields:
If you really need big number (hundreds of digits), then look into the modules that support them. For example: