dividing numbers
#1

hi , I want to do something like let's say if(4%2 == 0)
but samp doesn't have the function of % dividing, is there another available option?
Reply
#2

% is used for modulo and / is used for division.

Using
Code:
if(4%2 == 0) //do whatever
Is completely valid in PAWN.
Reply
#3

Quote:
Originally Posted by Chyakka
View Post
% is used for modulo and / is used for division.

Using
Code:
if(4%2 == 0) //do whatever
Is completely valid in PAWN.
I forgot it's called modulo, but what about floats?
Reply
#4

For dividing, use https://sampwiki.blast.hk/wiki/Floatdiv

Modulo Operation on Floats makes no sense, cause you have no remainder
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)