开发者

how to get the x to the pow y in C under c99 standard

I have #include<math.h>, and I tried to use pow(x, y) and powf(x, y). but it seems neither of them are under c99 standard. and I use the command gcc -std=c99 test.c -o test to compile. what function there exists I ca开发者_StackOverflow社区n use?


For histerical reasons, the math library is not bundled in with the rest of the Standard Library. You have to manually add it to the compilation with the -lm option to gcc.

gcc -std=c99 test.c -o test -lm


Did you link with the math lib?

  gcc -std=c99 test.c -o test -lm
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜