English Infinitive number in lua

7 replies
Goto Page
To the start Previous 1 Next To the start
21.06.20 11:31:07 am
Up
The Dark Shadow
User
Offline Off
How to create a variable equals to infinitive?

Would be appreciated
21.06.20 12:00:13 pm
Up
BcY
Reviewer
Offline Off
Are you kidding?
Kgb2d Community - Since 2012
21.06.20 12:15:03 pm
Up
Mami Tomoe
User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
function getInf()
     local num = 0
     
     while (true) do
          num = num + 1
     end
     
     return num
end



Just kidding, use
math.huge
.
Reference: http://lua-users.org/wiki/MathLibraryTutorial
fish
21.06.20 01:43:56 pm
Up
The Dark Shadow
User
Offline Off
@user Mami Tomoe: Oh man...I will give you a deep thank when you left Tomoe Mami
21.06.20 01:49:09 pm
Up
Mami Tomoe
User
Offline Off
@user The Dark Shadow: That would be, never.
fish
22.06.20 04:05:57 am
Up
MikuAuahDark
User
Offline Off
local infinity = 2^1024
or
local infinity = 1/0

Your welcome.
file cs2d LuaJIT for Dedicated Server (13) JIT POWER! | Know your Lua errors! | Part of LÖVE development team since 11.3
22.06.20 09:52:25 am
Up
The Dark Shadow
User
Offline Off
@user MikuAuahDark: I wonder why
2^1024
is the limit.
22.06.20 10:09:21 am
Up
Mami Tomoe
User
Offline Off
@user The Dark Shadow: It's higher than the maximum number Lua can display, I presume.
fish
To the start Previous 1 Next To the start