Why does the C++ expression 1 / 2 produce 0 rather than 0.5?
1 / 2
0
0.5
Division has lower precedence than every other arithmetic operator
Both operands are integers, so integer division discards the fractional part
C++ does not support fractional division
The / operator returns only the remainder
/