Removing filex.Append 1.#INF

So… I decided to make a power generator:

[lua]
include( “helix.lua” )
local poweramt = CreateClientConVar( “helix_power_amt”, 500, true )

if not file.Exists( “HelixScripts/powers.txt” ) then
file.Write( “HelixScripts/powers.txt”, “” )
end

local function SavePower( ply, cmd, args )
local p = args or “N/A”
local a = string.Implode( " ", p )

for i = 1, poweramt:GetInt() do
	filex.Append( "HelixScripts/powers.txt", a .. "^" .. i .. " >>> " .. a^i .. "

" )
end
Msg( ">>> File HelixScripts/powers.txt wrote to successfuly with power " … a … "
" )
end
concommand.Add( “helix_power”, SavePower)
[/lua]
Unfortunately… this happens:
2^1020 >>> 1.1235582092889e+307
2^1021 >>> 2.2471164185779e+307
2^1022 >>> 4.4942328371558e+307
2^1023 >>> 8.9884656743116e+307
2^1024 >>> 1.#INF
2^1025 >>> 1.#INF
and
2^1020 >>> 1.1235582092889e+307
2^1021 >>> 2.2471164185779e+307
2^1022 >>> 4.4942328371558e+307
2^1023 >>> 8.9884656743116e+307
2^1024 >>> 1.#INF
2^1025 >>> 1.#INF
2^1026 >>> 1.#INF
etc…

Is there anyway to remove that 1.#INF?

It just means the number is too big. You could do something like this:


local n = a^i
if n == math.huge then n = "too big!" end

Yeah. But the point of this is to find out how to remove that protection. Thanks anyways though.

What do you mean protection? I don’t think it’s really possible. That’s as far as your computer is willing to go. Perhaps try the number in a different base? Not really sure.

You can’t remove that, it isn’t a protection, it is a limitation.

You do know it’s called filex because it’s an old unused function right? You should really look for another method.