0

Why modules operator cannot be applied on a float?

Float

17th Dec 2018, 1:32 PM
Piyush _*
Piyush _* - avatar
2 odpowiedzi
0
Because the mathematical usage of % is only for integer.. but languages like c# and java it is possible to use it but it actually use this equation to calculate it: float a, b; int q = (int)(a/b); float result = a - (q * b) so you can use the above equation if you need to find modulus on two float in languages like c/c++!
17th Dec 2018, 2:34 PM
Sekiro
Sekiro - avatar