Where is pow function defined and implemented in C

2019-02-18 13:30发布

I read that the pow(double, double) function is defined in "math.h" but I can't find its declaration.

Does anybody know where this function declared? And where is it implemented in C?

Reference:

http://publications.gbdirect.co.uk/c_book/chapter9/maths_functions.html

8条回答
走好不送
2楼-- · 2019-02-18 14:26

Its here and also here. Also go on wikipedia

You will find pow there.

查看更多
做自己的国王
3楼-- · 2019-02-18 14:29

The actual implementation of pow may vary from compiler to compiler. Generally, math.h (or a vendor-specific file included by math.h) provides the prototype for pow (i.e., its declaration), but the implementation is buried in some library file such as libm.a. Depending on your compiler, the actual source code for pow or any other library function may not be available.

查看更多
登录 后发表回答