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 can use?
views:
54answers:
2
+6
A:
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
pmg
2010-10-21 15:55:56
+1 for *histerical* reasons. :-)
R..
2010-10-21 16:01:33
@R..: I've always wanted to say that ... in a meaningful sentence!
pmg
2010-10-21 16:05:40