mirror of https://github.com/GNOME/gimp.git
R5RS compatibility fix for the modulo procedure (SourceForge bug #3395547)
This commit is contained in:
parent
a21bba4cab
commit
1574700215
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue