diff options
author | Yixin Shou <yixin.shou@intel.com> | 2014-08-26 15:15:13 -0400 |
---|---|---|
committer | Yixin Shou <yixin.shou@intel.com> | 2014-08-27 20:36:09 -0400 |
commit | 2ddd175d74acc316293f5949746c637260437a49 (patch) | |
tree | 2cafdc8199d6d3785783de6019807e53306f19e9 /test/012-math | |
parent | 0038fcaa6f2457f5de5544fc93cd57a305e466de (diff) | |
download | art-2ddd175d74acc316293f5949746c637260437a49.zip art-2ddd175d74acc316293f5949746c637260437a49.tar.gz art-2ddd175d74acc316293f5949746c637260437a49.tar.bz2 |
Add numerator check for integer divide and modulo
Implemented numerator == 0 optimization for integer divide and modulo
Change-Id: I6e3bff4a9f68d2790394f7df6106a948003a04c4
Signed-off-by: Yixin Shou <yixin.shou@intel.com>
Diffstat (limited to 'test/012-math')
-rw-r--r-- | test/012-math/expected.txt | 8 | ||||
-rw-r--r-- | test/012-math/src/Main.java | 20 |
2 files changed, 28 insertions, 0 deletions
diff --git a/test/012-math/expected.txt b/test/012-math/expected.txt index af9708e..75a559e 100644 --- a/test/012-math/expected.txt +++ b/test/012-math/expected.txt @@ -30,3 +30,11 @@ f:3.0 f:21.0 f:3.0 f:3.0 +0 +0 +0 +0 +0 +0 +0 +0 diff --git a/test/012-math/src/Main.java b/test/012-math/src/Main.java index a4a8c71..07b7540 100644 --- a/test/012-math/src/Main.java +++ b/test/012-math/src/Main.java @@ -99,7 +99,27 @@ public class Main { f %= g; System.out.println("f:" +f); } + public static void math_012_numerator(int a, int b, int d, int e, int f) { + int c = 0; + c /= b; + System.out.println(c); + c %= b; + System.out.println(c); + c = a / b; + System.out.println(c); + c = a % b; + System.out.println(c); + c = c / d; + System.out.println(c); + c = c / e; + System.out.println(c); + c = c / f; + System.out.println(c); + c = c % f; + System.out.println(c); + } public static void main(String args[]) { math_012(); + math_012_numerator(0, 3, -1, 4, 5); } } |