diff options
author | Andrew Gallasch <andrewgallasch@gmail.com> | 2017-10-30 23:58:22 +1030 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-30 23:58:22 +1030 |
commit | 833c7bea6ced906d32e4029e704d1a2a831c9b05 (patch) | |
tree | 2bc0d107203f78d5bc475e8c58480a692c58efe3 /java.html.markdown | |
parent | ab34af7c2da3cde96e5c1005c66f290001a15d48 (diff) |
Improve arithmetic output
Diffstat (limited to 'java.html.markdown')
-rw-r--r-- | java.html.markdown | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/java.html.markdown b/java.html.markdown index 36d56625..dd875c16 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -312,7 +312,7 @@ public class LearnJava { System.out.println("2-1 = " + (i2 - i1)); // => 1 System.out.println("2*1 = " + (i2 * i1)); // => 2 System.out.println("1/2 = " + (i1 / i2)); // => 0 (int/int returns int) - System.out.println("1/2 = " + (i1 / (double)i2)); // => 0.5 + System.out.println("1/2.0 = " + (i1 / (double)i2)); // => 0.5 // Modulo System.out.println("11%3 = "+(11 % 3)); // => 2 |