Floating point calculation in Microblaze

Feb 20, 2004 1 Replies

Dear all,



I am trying to do floating point addition, subtraction, multiplication and division in Microblaze.



According to the specification, it is possible to do so as EDK included the required library automatically



But after verifying that the library libc.a, libm.a and libxil.a are included and math.h is also included in the source C program, I still cannot perform the calculation.



float a=6.4; float b=7.2; float c=3.4;



printf("%f, %f, %f", a,b,c); c=a+b; printf("%f, %f, %f", a,b,c);



i can print out the result correctly the first time, but in the second time, the value of c becomes 0? 00000000...



Is there any more stuff I need to do to solve the problem.



Thanks


Hi,

Which version of EDK are you using? The basic floating point support has been existing for quite some time. I checked with EDK 6.1 SP2 and the addition mentioned in this email does work.

Sid

K> Dear all,

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required