0
Why I can't division two variables with defirent type?
For example: func main() { a, b, c := arithmetic(2, 5, 8) println(a, b, c) } func arithmetic(x, y, z int) (int, int, float32) { sum := x + y multiplication := sum * z return sum, multiplication, z / multiplication } Here more detail: https://play.golang.org/p/KTsMA2rAiey
1 Antwort
0
The code will of course run but the result will not be correct. With this approach I would get the following values: 7 56 0. 8 divided by 56 should not be 0. This is what I wanted to know how to do. Although I already did, here: https://play.golang.org/p/2_fW4mKV5D7