From: Matthias Reitinger Date: 2009-04-08T21:30:06+09:00 Subject: Re: what is happening here George George wrote: > i have some perl code > > while ($high - $low > 0.001) { # precision > # calculate the sum of all normalized scores > my $sum = Pn * Pn * exp($lambda * $match) * 4 > + Pn * Pn * exp($lambda * $mismatch) * 12; > [...] > trying to rewrite this in ruby > while (high - low > 0.001) > #calculate the sum of all normalized scores > sum = Pn * Pn **(lambda * match) * 4 + Pn * Pn **(lambda * mismatch) * > 12 It seems like you're using the ** operator wrong. You should use Ruby's Math.exp instead (which is the direct equivalent to Perl's exp). -Matthias