• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Integer even or odd?

Status
Not open for further replies.
Level 4
Joined
Jul 11, 2007
Messages
82
How can I find if an integer (a unit's custom value) is even or odd? I want to do something like this:

JASS:
if (GetUserData(GetTriggerUnit)) is even then
     call 
else //it's odd
     call
endif
 
Level 7
Joined
Jul 20, 2008
Messages
377
ModuloInteger or ModuloReal.

JASS:
if ModuloReal(yourdatahere, 2)==0 then yourdatahere is even
else yourdatahere is NOT even
 
Status
Not open for further replies.
Top