summaryrefslogtreecommitdiffhomepage
path: root/java.html.markdown
diff options
context:
space:
mode:
authorAndrew Gallasch <andrewgallasch@gmail.com>2017-10-30 23:58:22 +1030
committerGitHub <noreply@github.com>2017-10-30 23:58:22 +1030
commit833c7bea6ced906d32e4029e704d1a2a831c9b05 (patch)
tree2bc0d107203f78d5bc475e8c58480a692c58efe3 /java.html.markdown
parentab34af7c2da3cde96e5c1005c66f290001a15d48 (diff)
Improve arithmetic output
Diffstat (limited to 'java.html.markdown')
-rw-r--r--java.html.markdown2
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