• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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