Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#26 modulo broken

closed-fixed
nobody
None
5
2011-08-29
2011-08-21
Doug Currie
No

Modulo is still broken (discovered with Aubrey Jaffer's r4rstest.scm)

Here's my fix:

@@ -463,14 +463,8 @@
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;

Discussion

  • Kevin Cozens
    Kevin Cozens
    2011-08-29

    Committed as revision 77.

     
  • Kevin Cozens
    Kevin Cozens
    2011-08-29

    • status: open --> closed-fixed