lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Oct 18, 2021 at 9:47:47 AM, Flyer31 Test <flyer31@googlemail.com> wrote:

thank you for fast answer - sorry for misunderstanding.

I do not want to change this in Lua code.

I want to change the C machine of Lua to use my own frexp (some new
function, which I write by myself, e. g. myfrexp).


Right, that’s what I assumed. I just wrote it in pseudocode, which perhaps looked a bit like Lua. You can use the CORDIC based exp and log to build your myfrexp. (There are faster approaches than CORDIC for exp and log, but if you already have them in hand it’s a good place to start.)

See https://stackoverflow.com/a/17892402/33252 , where expt is called “pow,” and its links for some background on the special cases and edge cases to be concerned about.

e