Hi,

I've got a build of odff05 now and want to continue work. I need expm1 and log1p (issue 91602). I can put the following code into sal\inc\rtl\math.hxx, so I can use the functions with ::rtl::math::expm1 and ::rtl::math::log1p in interpr*.cxx

Is it necessary to have a solution, which switches, dependent on the compiler? If yes, how can I do it?

kind regards
Regina


/** The MSVC compilers do not provide expm1 and log1p. The following functions are an ersatz for them.
*/

inline double expm1(double x)
{
    double u = exp(x);
    if (u == 1.0)
        return x;
    if (u-1. == -1.0)
        return -1.0;
    return (u-1.0)*x/log(u);
}

inline double log1p(double fX)
{
    double fU = 1.0+fX;
    if (fU == 1.0)
        return fX;
    else
        return log(fU)*fX/(fU-1.0);
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to