From 668a067bb358cfa2a9682e0621e2a3b075d15e1d Mon Sep 17 00:00:00 2001
From: Lucas Wawrzyniak <lucas.wawrzyniak@gmail.com>
Date: Fri, 19 Jun 2020 15:13:39 +0200
Subject: [PATCH] Numeric operations using float

---
 03-basic-types/03-numeric-operations/main.go | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/03-basic-types/03-numeric-operations/main.go b/03-basic-types/03-numeric-operations/main.go
index 6f9aaec..5148663 100644
--- a/03-basic-types/03-numeric-operations/main.go
+++ b/03-basic-types/03-numeric-operations/main.go
@@ -7,7 +7,7 @@ import (
 
 func main() {
 	var a, b = 4, 5
-	var res1 = (a + b) * (a + b)/2  // Arithmetic operations
+	var res1 = (a + b) * (a + b) / 2 // Arithmetic operations as int
 
 	a++ // Increment a by 1
 
@@ -16,7 +16,10 @@ func main() {
 	var res2 = a ^ b // Bitwise XOR
 
 	var r = 3.5
-	var res3 = math.Pi * r * r  // Operations on floating-point type
+	var res3 = math.Pi * r * r // Operations on floating-point type
 
-	fmt.Printf("res1 : %v, res2 : %v, res3 : %v\n", res1, res2, res3)
-}
\ No newline at end of file
+	var c, d = 4.0, 5.0
+	var res4 = (c + d) * (c + d) / 2 // Arithmetic operations as float
+
+	fmt.Printf("res1 : %v, res2 : %v, res3 : %v, res4 : %v\n", res1, res2, res3, res4)
+}