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
b = pow(2,1); the result is 1. OK ! Huh? In which mathematical universe would 2^1 == 1 be OK? The correct result is 2, not 1.
yes of course.... I've mistaken when writting the post... Stephane
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)?