What is the difference of big or small number by calling bignum module?
When my code tested on 2 digit small number it's good to run, but change to real large number it gives out error:
can't return outside a subroutine.....
When I again test the error subroutine individually with real big number, it works good again
The code has no problem otherwise small number won't run. But why it give error on large numbers?
Here is just little subroutine, tested good on itself
use bignum;
$big_number = xxxxxx; #declared a 100 digits integer.
$another_big_number=xxxxxx;# 100 digits.
print operation($another_big_number);
sub operation {
my $product = eval $_[0];
return abs $big_number - $product;
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.