Re: [sc-dev] Implement expm1 and log1p

2008-12-03 Thread Regina Henschel

Hi Eike,

I've attached it in patch form to issue 91602

kind regards
Regina

Eike Rathke schrieb:

Hi Regina,

On Monday, 2008-12-01 16:06:53 +0100, Regina Henschel wrote:

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


Yes, that should do. I'll also add the already existing patch of i94555
to CWS odff05 today.

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


I don't think that's necessary. We can always use our own expm1 and
log1p, regardless of whether the compiler provides its own.

  Eike




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



Re: [sc-dev] Implement expm1 and log1p

2008-12-03 Thread Eike Rathke
Hi Regina,

On Monday, 2008-12-01 16:06:53 +0100, Regina Henschel wrote:

> 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

Yes, that should do. I'll also add the already existing patch of i94555
to CWS odff05 today.

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

I don't think that's necessary. We can always use our own expm1 and
log1p, regardless of whether the compiler provides its own.

  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
 SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to the [EMAIL PROTECTED] account, which I use 
for
 mailing lists only and don't read from outside Sun. Use [EMAIL PROTECTED] 
Thanks.


pgpNDF07zKR1x.pgp
Description: PGP signature


[sc-dev] Implement expm1 and log1p

2008-12-01 Thread Regina Henschel

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]