Hello to everyone,
In the documentation of
Math::BigInt it's mentioned that it can work with numbers that have thousands od digits. Though, i ran to a slight proplem with the following code :
...
my ($in_out) = @_;
my ($out,$diver,$grade) = split(/,/, $in_out, 3);
my $in = Math::BigInt->new(($out)**(1/$grade)*$diver);
...
when $in_out is 2.84894533078051,5,0.002 , but when i try to print $in, i get :
10990761002367800000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000
my first question is WHY ?
and the second question is how do i make it print the real reasult which should be :
10990761002372220870980990761002372220870980980980990761002372220
87098099076100237222087098099076100237222087098098098099076100237
22208709809907610023722208709809907610023722208709809809809907610
0237222087098099076100237222087098
???
Large numbers broken up to multiple lines to prevent long lines causing horizontal scrolling, by davido.
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.