generic image
Processing...
  • Games
  • Catalog
  • Develop
  • ROBUX
  • Search in People
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • ROBUX
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

math function where rmeinader

Previous Thread :: Next Thread 
TheCoderOfLua is online. TheCoderOfLua
Joined: 12 Apr 2016
Total Posts: 1415
15 Jul 2017 10:13 PM
I know about math.fmod,

but I want something that you can put in to numbers, number to divide by, and dividend or wahtever,

and it says how many times it goes into.

I know i can do a for i = whatever

loop, but thats laggy and i want better

EX of what i want:


5, 16:
3

2, 19:
8
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 8145
15 Jul 2017 10:14 PM
What's wrong with flooring the result?


Report Abuse
TheCoderOfLua is online. TheCoderOfLua
Joined: 12 Apr 2016
Total Posts: 1415
15 Jul 2017 10:14 PM
Cause its not what im asking for.
Report Abuse
SlimeMan22 is online. SlimeMan22
Joined: 10 Mar 2012
Total Posts: 555
15 Jul 2017 10:14 PM
how would 2 and 19 return 8?

NULL > NIL
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 2366
15 Jul 2017 10:15 PM
Ya, wouldn't math.floor(math.abs(num1-num2)) work?

Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 8145
15 Jul 2017 10:15 PM
I'm not sure if anybody knows what you're asking for. What you posted makes absolutely no sense.


Report Abuse
samy22 is online. samy22
Joined: 28 Sep 2008
Total Posts: 2038
15 Jul 2017 10:15 PM
function a(number, multiple)
return (number - number%multiple)/multiple
end
Report Abuse
TheCoderOfLua is online. TheCoderOfLua
Joined: 12 Apr 2016
Total Posts: 1415
15 Jul 2017 10:15 PM
It rounds to int and i numbers im working with are decimals.
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 2366
15 Jul 2017 10:16 PM
lol, woops

function goesIntoXTimes(divisor,dividend)
return math.floor(math.abs(dividend/divisor))
end


Report Abuse
SlimeMan22 is online. SlimeMan22
Joined: 10 Mar 2012
Total Posts: 555
15 Jul 2017 10:17 PM
Yes, but, what kind of screwed up math do you want where 2 goes into 19 only 8 times?

NULL > NIL
Report Abuse
Casualist is online. Casualist
Joined: 26 Jun 2014
Total Posts: 3835
15 Jul 2017 10:17 PM
print( (math.modf(19/2)) )
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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.

Thanks for playing ROBLOX

  • 1

    Click RobloxPlayer.exe to run the ROBLOX installer, which just downloaded via your web browser.

  • 2

    Click Run when prompted by your computer to begin the installation process.

  • 3

    Click Ok once you've successfully installed ROBLOX.

  • 4

    After installation, click Play below to join the action!

    Play
The ROBLOX installer should download shortly. If it doesn’t, start the download now.
generic image