float64 from integer division

This commit is contained in:
Mihalis Tsoukalos 2019-01-29 10:41:35 +02:00
commit 2c08c58a57

View file

@ -32,7 +32,7 @@ func main() {
y := 4 / 2.3
fmt.Println("y:", y)
divFloat := float64(x / k)
divFloat := float64(x) / float64(k)
fmt.Println("divFloat", divFloat)
fmt.Printf("Type of divFloat: %T\n", divFloat)
}