|
| 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 |
|
|
|
| 15 Jul 2017 10:14 PM |
What's wrong with flooring the result?
|
|
|
| Report Abuse |
|
|
|
| 15 Jul 2017 10:14 PM |
| Cause its not what im asking for. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2017 10:14 PM |
how would 2 and 19 return 8?
NULL > NIL |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2017 10:15 PM |
Ya, wouldn't math.floor(math.abs(num1-num2)) work?
|
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 15 Jul 2017 10:15 PM |
| It rounds to int and i numbers im working with are decimals. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2017 10:16 PM |
lol, woops
function goesIntoXTimes(divisor,dividend) return math.floor(math.abs(dividend/divisor)) end
|
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 3835 |
|
|
| 15 Jul 2017 10:17 PM |
| print( (math.modf(19/2)) ) |
|
|
| Report Abuse |
|
|