0 Vote(s) - 0 Average 1 2 3 4 5 Help Number Multiples Tomsen1410 Unstoppable Joined: Jan 2011 Posts: 875 Reputation: 25 04-20-2011, 21:08 uhm lol in my code i wrote an else... but ive forgot it here   • master131 ItsModder Joined: Nov 2010 Posts: 713 Reputation: 74 04-25-2011, 09:39 (04-20-2011, 01:27)AZUMIKKEL Wrote: (04-20-2011, 01:15)master131 Wrote: % is the modulus operator. It gets the remainder when you divide a number by the other. 5 % 2 = 1 (5 divided by 2 has a remainder of 1) So it rounds the number down and calculates the amount it rounded down? So 8/3 would be 2,(2/3). 0,(2/3)*3 = 2 ? I wonder what this would ever be handy for. Maybe to check if a number is even or odd? Code: ```if(someNumber % 2 == 0) //If number is even (can be divided by 2 with no remainder)     //Do crap here else //Number is odd    //Do crap here``` A casual conversation between barata and I about Nukem.   •

 Possibly Related Threads... Thread Author Replies Views Last Post Your phone number? kokole 10 1,557 01-18-2013, 19:59 Last Post: JariZ exceeded maximum number of child1 script variables xplosiff 6 4,428 01-07-2012, 11:46 Last Post: xplosiff [Request] Weapon Change after certain Number of kills Scripts18 5 1,115 09-17-2011, 13:13 Last Post: Scripts18 [SOLVED] Removing the xp gain number from medal messages Cyborgking 7 1,808 09-15-2011, 16:05 Last Post: Cyborgking [Release] Getting the number after the point Pozzuh 7 1,487 09-01-2011, 18:51 Last Post: SuperNovaAO

Forum Jump:

Users browsing this thread: 1 Guest(s)