generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Is there a % math operator?

Previous Thread :: Next Thread 
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
25 Dec 2013 11:51 AM
In java, there's a % thing that gives you the remainder when you divide. Does ROBLOX have this?

EX.
5%2=1
4%2=0
25%9=7 --9 Goes into 25, 2 times. 25-(9*2)=7
Report Abuse
mic144 is not online. mic144
Joined: 14 Oct 2009
Total Posts: 1598
25 Dec 2013 11:55 AM
Roblox should give you the value+remainders unless you rounded up/down.

-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ --
Report Abuse
xninjawarriorx is not online. xninjawarriorx
Joined: 08 Apr 2011
Total Posts: 40
25 Dec 2013 11:56 AM
Yes.
Report Abuse
TaaRt is online. TaaRt
Joined: 26 Apr 2009
Total Posts: 5039
25 Dec 2013 11:56 AM
Can't imagine a language without Modulo
Report Abuse
StBashkir is not online. StBashkir
Joined: 29 Aug 2008
Total Posts: 26171
25 Dec 2013 11:59 AM
There's also this really nice math function that can split a number and a decimal - which I find just interesting.

local int, float = math.modf(5.255346534);
print(int, float);
>5       .255346534

Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
25 Dec 2013 12:02 PM
Neat!
Report Abuse
TaaRt is online. TaaRt
Joined: 26 Apr 2009
Total Posts: 5039
25 Dec 2013 12:03 PM
If there's anything ROBLOX should learn from java it is += and -=
Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
25 Dec 2013 12:04 PM
Yeah, I get tired of having to make a bunch of variables or typing the same things twice...
Report Abuse
shonclub is not online. shonclub
Joined: 05 Sep 2009
Total Posts: 1331
25 Dec 2013 12:05 PM
Don't forget .=
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image