This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

pow(x,y) computation problems

Hi all,


I've wrote this :

a = pow(2,0);
the result is a = 295 !!!

b = pow(2,1);
the result is 1. OK !

I've read at the following link :
http://www.keil.com/support/docs/259.htm
it says the math.h lib has a bug in C51 V5.10

I'm currently using C51 V5.50. Is this bug reported in this version ?

If not, have you an idea of the problem ?


Regards
Stephane

Parents

  • I get the correct results with 7.02.

    Did you double-check your declarations to be sure everything is "float"? Your function call shows literal integers, which will be converted implicitly, but make me wonder about the code we can't see. If you check the result with printf(), could you be using "%d" (etc) instead of "%f" (etc)?

Reply

  • I get the correct results with 7.02.

    Did you double-check your declarations to be sure everything is "float"? Your function call shows literal integers, which will be converted implicitly, but make me wonder about the code we can't see. If you check the result with printf(), could you be using "%d" (etc) instead of "%f" (etc)?

Children
No data