Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Misunderstanding with Math::BigInt

by jgamble (Pilgrim)
on Jun 30, 2005 at 21:20 UTC ( #471484=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Misunderstanding with Math::BigInt
in thread Misunderstanding with Math::BigInt

As your code stands now, your variables are handled solely by perl's own internal representation, and aren't converted into bigints until the very last minute, after the exponentation and multiplication. At that point it is too late to preserve the extra tens of digits that you want, because they aren't there to be preserved.

Convert your $out, $driver, and $grade variables to bigints before you do any exponentation and multiplying.

By the way, don't you mean to use Math::BigFloat instead?

John


Comment on Re^3: Misunderstanding with Math::BigInt

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://471484]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (16)
As of 2014-07-22 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (113 votes), past polls