Author: Maciej Fijalkowski <[email protected]>
Branch: 
Changeset: r368:8c466b875875
Date: 2013-07-08 10:19 +0200
http://bitbucket.org/pypy/stmgc/changeset/8c466b875875/

Log:    fix division

diff --git a/duhton/glob.c b/duhton/glob.c
--- a/duhton/glob.c
+++ b/duhton/glob.c
@@ -198,7 +198,9 @@
 
 DuObject *du_div(DuObject *cons, DuObject *locals)
 {
-    int result = 1;
+    int result = 0;
+       int first = 1;
+
     while (cons != Du_None) {
         _du_read1(cons);
         DuObject *expr = _DuCons_CAR(cons);
@@ -206,7 +208,12 @@
 
         _du_save2(next, locals);
         DuObject *obj = Du_Eval(expr, locals);
-        result /= DuInt_AsInt(obj);
+               if (first) {
+                       result = DuInt_AsInt(obj);
+                       first = 0;
+               } else {
+                       result /= DuInt_AsInt(obj);
+               }
         _du_restore2(next, locals);
 
         cons = next;
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to