R5RS compatibility fix for the modulo procedure (SourceForge bug #3395547)

This commit is contained in:
Kevin Cozens 2011-08-29 12:39:24 -04:00
parent a21bba4cab
commit 1574700215
1 changed files with 2 additions and 9 deletions

View File

@ -517,15 +517,8 @@ static num num_mod(num a, num b) {
e2=num_ivalue(b);
res=e1%e2;
/* modulo should have same sign as second operand */
if (res > 0) {
if (e2 < 0) {
res*=-1L;
}
} else {
if (e2 > 0) {
res*=-1L;
}
}
if (res * e2 < 0) {
res+=e2;
ret.value.ivalue=res;
return ret;
}