|
| 27 Mar 2015 08:34 PM |
Say make a huge number in a for loop, would studio basically crash?
for a = 1,_ --insert large number here print(a) end
If it doesn't crash, it would just print everything but I don't see how it could go so fast if it's a large number. |
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 27 Mar 2015 08:35 PM |
| stack overflow it wouldn't run once because 1 is > -99e99 |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 08:35 PM |
Whoops, forgot 'do'
for a = 1,_ do --insert large number in blank print(a) end |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 08:36 PM |
| It depends on how large of a number it is. |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 08:39 PM |
See, I tested it in Codepad. I see it has a limit, as it ended with 'timeout'
http://codepad.org/c48CrW0E |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 08:41 PM |
| But I'm not sure if it works the same with rbx.lua in studio. Would it? Would the output display "timeout" or something related to that? |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 08:52 PM |
| you need a wait() because you cant value's that fast and then get the value from the variable, because its changing so fast... xD |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 09:07 PM |
| A timeout happens if you don't yield for 30 or more seconds. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 27 Mar 2015 09:11 PM |
025 you have no idea what stack overflows are apparently.
And if it's big enough it might eventually finish (depending on how big it is, ofc.) but if you have to use such a huge number, consider yielding a bit. |
|
|
| Report Abuse |
|
|
LucasLua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
|
| 27 Mar 2015 09:14 PM |
| It would freeze Roblox Studio due to the print line, but if you were to say only add one number up like a counter then it shouldn't crash no matter the size (unless you use math.huge, which is the Lua representation of infinite). The print function is actually very resource intensive compared to simple operations like addition. |
|
|
| Report Abuse |
|
|
LucasLua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
|
| 27 Mar 2015 09:15 PM |
| I'm mistaken, Roblox Studio will still freeze if you make the number super large, such as over 10 digits. lol |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 10:10 PM |
| Alright, got it. Just wanted to clear it up, thanks. |
|
|
| Report Abuse |
|
|