| Author |
Pow() doesn't give me the correct result
|
|
|
| I tried to obtain the power of a number i.e say I used something like
pow(2.0,3.0) in my program. Initially it said error undefined symbol :
pow() . Then I linked the library libbsd.a. Then it got cmpiled but its
displayed some garbage value as output.
Can anybody let me know where I'm missing ?
Thanks
Ram
| |
| Rainer Temme 2006-09-16, 1:43 pm |
| Ram wrote:
> I tried to obtain the power of a number i.e say I used something like
> pow(2.0,3.0) in my program. Initially it said error undefined symbol :
> pow() . Then I linked the library libbsd.a. Then it got cmpiled but its
> displayed some garbage value as output.
>
> Can anybody let me know where I'm missing ?
#include <math.h>
Rainer
| |
| DaVinci 2006-09-17, 1:28 am |
|
Ram wrote:
> I tried to obtain the power of a number i.e say I used something like
> pow(2.0,3.0) in my program. Initially it said error undefined symbol :
> pow() . Then I linked the library libbsd.a. Then it got cmpiled but its
> displayed some garbage value as output.
>
> Can anybody let me know where I'm missing ?
>
> Thanks
> Ram\
link the library -lm ?
double d = pow(2.0,3.0);
printf("%ld\n",d)//d = 0;
why?
|
|
|
|