Get Modulo from division - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Get Modulo from division (
/showthread.php?tid=421077)
Get Modulo from division -
pasha97 - 08.03.2013
I hope you understand what is Modulo. It is what is remaining after we divide values. For example: when 10 divided by 5 we get value 2, and modulo is 0. But if 10 divided by 3 we get value 3 and a modulo is 1, because 3*3=9, 10-9 = 1
So i need to find some operator in pawn which could divide values with modulo to get that modulo. I found in ****** that there is an operator % for this, but if i do it, i get error:
Код:
error 004: function "operator%(Float:,Float:)" is not implemented
What to do?
Re: Get Modulo from division -
RajatPawar - 08.03.2013
It should work!
pawn Код:
for(new i; i< 10; i++)
{
if(i%2 == 0) printf("%d", i);
else continue;
}
For example, this will print all numbers within ten divisible by 2 ! See if your usage is correct.
Re: Get Modulo from division -
mastermax7777 - 08.03.2013
show us your code... (line number)