This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Problem with ARM port and pow() function
- From: Fau Marz <faumarz at libero dot it>
- To: newlib at sourceware dot org
- Date: Mon, 15 Oct 2007 11:43:33 +0200
- Subject: Re: Problem with ARM port and pow() function
- References: <200710101956.59975.faumarz@libero.it>
Alle 19:56, mercoledì 10 ottobre 2007, Fau Marz ha scritto:
> I am using newlib with gcc in an ARM7 cross compiling toolchain
> (arm-elf-gcc) and I've found a problem in using the pow(x,y) function.
>
> The problem is like that: when in pow(x,y) the "y" factor is an integer,
> there is no problem. But when the "y" factor is a double or float (for
> example "2.1") there is a data exception and the program hangs. Crash.
I've done some tests, and I can't understand what's wrong.
It seems that the problem is in the e_pow.c file, the line:
p_l = (y-y1)*t1+y*t2;
It seems that t1 contains a too big variable, causing overflow.
I can't understand... I've done a lot of tests with compilation options
because I supposed it was a BIG_ENDIAN/LITTLE_ENDIAN problem, but I have
always the same behaviour.
Maybe it's a linking problem of my project (not in newlib), but I can't
understand it.
If you have any idea, please tell me.
Thank you for your attenction, even if this is probably not a strictly newlib
problem....
I've tried also the CodeSourcery arm-none-eabi pre-built toolchain, and the
problem is the same.
Regards,
Fausto
--
Faumarz