Does anyone know why integer division in C# returns an integer and not a float? What is the idea behind it? (Is it only a legacy of C/C++?)
In C#:
fl
Its just a basic operation. Remember when you learned to divide. In the beginning we solved 9/6 = 1 with remainder 3.
9/6 = 1 with remainder 3
9 / 6 == 1 //true 9 % 6 == 3 // true
The /-operator in combination with the %-operator are used to retrieve those values.