Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I get the quotient of a division in lua?

For my game in roblox, I need the quotient of a division. For example the quotient of 20/3 is 6 and 40/2 is 20. Is there a way to do this using a function?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Look at math.modf(a/b), which will return two values, the intergral and the fractional remainder.

a = 20
b = 3
q, _ = math.modf(a/b)
print(q)

will result in 6

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading