[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Exchange pow/frexp/ldexp (Lua power calculation)
- From: Flyer31 Test <flyer31@...>
- Date: Mon, 18 Oct 2021 16:11:11 +0200
oh, thank you, then principally nice.. .
But which header functions of Lua to I have to "tweek" to convice Lua
to use my "myfrexp" instead of the C standard function "frexp".
(and next question would be whether lua possibly also uses one of the
other pwer functions like pow log etc... but I assume not as far as I
looked to the code so far - it is a bit diffecult to be sure at this
point, because there is somehow very deep in Lua and there much is
done by macros, thus, then somehow hiding at least any of my "ASCII
search attacks" for frrexp... ).
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
>