lua-users home
lua-l archive

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


Sorry, I found it now... I always looked for powf, which is somehow
stupid of course at it is somehow clear that they have some macro to
add the f and the l depending on lua32/64... .

So now I looked to all invocations of this math_op macro, and then it
is very clear that there is the pow invocation for exponentiation in
lobject.h ... . All fine, thank you.

On Mon, Oct 18, 2021 at 3:59 PM Doug Currie <doug.currie@gmail.com> wrote:
>
> 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
>