From 833c7bea6ced906d32e4029e704d1a2a831c9b05 Mon Sep 17 00:00:00 2001 From: Andrew Gallasch Date: Mon, 30 Oct 2017 23:58:22 +1030 Subject: Improve arithmetic output --- java.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3