0
Why can't float compile %? So how to get the surplus of decimal divisions?
2 Respuestas
+ 1
I answered this a while ago, but it would probably be hard to find. The modulo operator (%) calculates the integer remainder of division of two integers. If you think about it, a float contains the remainder of a division in the numbers after the decimal. For example, 3 % 2 will give 1 and 3 / 2 will give 1.5 as a float. 0.5 x 2 is 1, the integer remainder. This is why it's not necessary or wanted for float division.
0
Hello. The % is only aviable for two integer. The result of the the division of floats is another float.