|
| 18 Aug 2016 12:51 PM |
print(5e18 % 7)
In lua's official site, it outputs 5. But in Roblox, it outputs 0? Is there a fix to this (maybe http service)?
This siggy is copyrighted © |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 18 Aug 2016 01:03 PM |
| You probably didn't notice that roblox uses Lua 5.1, not 5.3. |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 01:03 PM |
i noticed it before i made this thread do those versions really matter
This siggy is copyrighted © |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 18 Aug 2016 01:05 PM |
| In Lua 5.1 all numbers are doubles, in Lua 5.3 there are real integers as a number sub-type. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 18 Aug 2016 01:11 PM |
Use fmod
local num = 5e18
print(math.fmod(num,7))
>> 5
|
|
|
| Report Abuse |
|
|