note
chuckbutler
<p>
If you are on a 32-bit system, you must use [mod://Math::BigInt]. The following returns <c>2348273369088</c>.
</p>
<c>
#!/usr/bin/perl
use strict;
use warnings;
use integer;
use Math::BigInt;
my %iupac_dgn;
my @iupac_code = ('M','R','W','S','Y','K','V','H','D','B','N');
my @iupac_den = ('2','2','2','2','2','2','3','3','3','3','4');
@iupac_dgn{@iupac_code}=@iupac_den;
my $string = 'GGNMDNNSNNNNDBNVWVSMNNHYNBNG';
my @residues = split(//, $string);
my $degeneracy = Math::BigInt->new( 1 );
foreach my $residues(@residues){
$degeneracy *= $iupac_dgn{$residues} || 1;
}
printf "%28s, %30s\n", $string, $degeneracy;
</c>
<p><i>Update:</i> I will concur with [Tye] as long as the result is less than 2 ** 49 on a 32b machine/implementation. Thanks.
</p>
<p>
Good Luck. -c
</p>
831146
831148