[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: [humour] [ANN] Arbitrary Precision Arithmetic Library
- From: Griffin Rock <abcq2@...>
- Date: Fri, 20 Dec 2019 02:44:04 +0000
Can someone help me get this onto LuaRocks?
-- dc.lua
return function (...)
local cmd = 'dc "-e %s p"'
local prg = table.concat({...}, " ")
local dc = io.popen(cmd:format(prg))
local result = dc:read(); dc:close()
return result
end
-- example
x = "1"; y = "1"
for i = 1,100 do
x,y = y,dc(x, y, "+")
end
print(y)