do you understand what modulus does? It gives you the remainder after division. 4/10 is 0 and 4%10 is 4, as 10 goes into 4 zero times leaving 4 as a remainder.
Let me see if I have this clear then:
The answer is 0.4 right?
So, 4/10 will give me the first part: 0
and, 4%10 will give me everything after the decimal: 4
I was thinking it gave the long-division remainder.
But if that's how it works, then, thanks for the help/clarification!
no it doesn't give you the bit after the decimal point, as it doesn't give you any value related to the result of long division like you're thinking.
if you do long division on 5/2 for example you get 2.5, but with integer division 5/2 is 2 and 5%2 is 1, as 5/2 leaves a remainder of 1, the modulus gives you the remainder after integer division, not the number after the decimal point, there is no decimal point with integers, only whole numbers