gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6349148)
raw | patch | inline | side by side (parent: 6349148)
author | Doni Pracner <quinnuendo@gmail.com> | |
Tue, 26 Nov 2013 20:00:06 +0000 (21:00 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Tue, 26 Nov 2013 20:00:06 +0000 (21:00 +0100) |
src/mjc2wsl.java | patch | blob | history |
diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java
index c269f20ef53852419341bd77ad9fd374c888d976..86177134f1bd3cc9d6656c6afa286bd50c501b45 100644 (file)
--- a/src/mjc2wsl.java
+++ b/src/mjc2wsl.java
}
case div: {
prl(getTopTwo());
- prl("tempres := tempb / tempa;");
+ prl("IF tempa = 0 THEN ERROR(\"division by zero\") FI;");
+ prl("tempres := tempb DIV tempa;");
+ prl(cmdToEStack("tempres"));
+ break;
+ }
+ case rem: {
+ prl(getTopTwo());
+ prl("IF tempa = 0 THEN ERROR(\"division by zero\") FI;");
+ prl("tempres := tempb MOD tempa;");
prl(cmdToEStack("tempres"));
break;
}