Ilya Zakharevich on Thu, 19 Sep 2024 10:42:02 +0200


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

Re: A missing (?) function: exponentfp(x)


On Thu, Sep 19, 2024 at 01:30:30AM -0700, Ilya Zakharevich wrote:
> Unfortunately, thinking of this more: no go.  You cannot pass through
> a double without a correction of large exponents…

So: anyway, one needs a way to construct a mantissa as a (1-word?)
PARI real number.  Then having a choice of doing
exponent()+mantissa()-1 can save a handful of CPU cycles (when this
really matters)…

So far, it seems like implementing it as flags via
    exponent(n, {flags=0})
(integer, or linear-approximation, or double-approximation) might be
a smoother user’s interface…

Puzzled,
Ilya