[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [humour] [ANN] Arbitrary Precision Arithmetic Library
- From: Steve Litt <slitt@...>
- Date: Tue, 31 Dec 2019 13:55:23 -0500
On Fri, 20 Dec 2019 02:44:04 +0000
Griffin Rock <abcq2@hotmail.com> wrote:
> 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)
Isn't that a Fibbonacci generator?
And this post brings up the question: Is there a Lua add-on that does
RPN arithmetic?
Thanks,
SteveT
Steve Litt
December 2019 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21