integer division
Dividing two whole numbers, which drops the fraction.
When both operands of / are integers, the result is the quotient truncated toward zero; % gives the remainder.
Examples
7 / 2is 3 and7 % 2is 1; write7 / 2.0to get 3.5.
Dividing two whole numbers, which drops the fraction.
When both operands of / are integers, the result is the quotient truncated toward zero; % gives the remainder.
Examples
7 / 2 is 3 and 7 % 2 is 1; write 7 / 2.0 to get 3.5.