This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: I cannot use the math funciton,such as log()


On 27 November 2006 14:14, Tan Ping wrote:

> Hi,
>   When I use the math function , the program can be complied
> successfully.But when I download it into the s3c2410 board and run it,
> the result is wrong?
>   What is the matter? Can you help me?
>   I use the arm-linux-gcc-2.95.3,

  That's rather old, but it's probably not the cause.

> the code is :
> #include <math.h>
> #include <stdio.h>
> int main()
> {
>    float a,b;
>    a=4.0;
>    b=log(a);
>    printf("a=%f,b=%f\n",a,b);
> }
> The result of running is:
>  a=4.0,b=4.0
> the b's value is wrong!

  I think the heart of the problem might be revealed in the answer to these
two questions:

1)  Does the particular ARM cpu on your board have an FPU?
2)  Is the version of gcc you're using configured for hardware or software fp?



    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]