+ 1
Modulo
1.25 % 0.5 = 0.25 How is that possible?
4 Respostas
+ 1
The modulo will subtract 20 by 6 until a fractional or decimal value is reached. This means it gives you the remainder of division between 20 and 6. 20 - 6 = 14, 14 - 6 = 8, 8 - 6 = 2, and 2 - 6 < 0, so your answer is 2
+ 1
Joy
% will give you remainder
There's a formula :
Dividend = Quotient* Divisor + Remainder
1.25 = 0.5* 2 + remainder
Remainder = 1.25 - 1.00 = 0.25
0
Returns remainder after dividing .if not divisible then it returns the number itself.