Perl: the Markov chain saw | |
PerlMonks |
Re: negative numbers when doing multiplications?by moritz (Cardinal) |
on Mar 26, 2010 at 13:30 UTC ( [id://831148]=note: print w/replies, xml ) | Need Help?? |
With some small fixes to your code I do get a (large) positive number, namely 2348273369088 (I'm on a 64bit system, if that matters).
Things you can try: use bigint (see bigint), and use ordinary print instead of printf() for debugging. Finally your hash access is unnecessary complicated - instead of the grep you can just access $iupac_dgn{$residues} directly. The simplified code looks like this:
Perl 6 - links to (nearly) everything that is Perl 6.
In Section
Seekers of Perl Wisdom
|
|