$numer = (($a*$d + $b*$c)*$f - ($b*$d*$e));
$denom = ($b*$d*$f);
my $count;
for ($count=2; $count<10; $count++) {
if (($numer % $count == 0) && ($numer % $count == 0)) {
$numer = $a/$count;
$denom = $b/$count;
$count = $count-1;
}
}
When in a conventional perl script for $numer = 75 and $denom = 21 the previous routine sets $numer = 25 and $denom =7.
In my WeBWorK question 1 and 0.3333 are returned respectively for $numer and $denom. Why might this be so? Is this something to do with the mod symbol?
Zak