Where is pow function defined and implemented in C?

后端 未结 8 1019
生来不讨喜
生来不讨喜 2021-01-14 11:29

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 i

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-14 12:11

    Where it's defined depends on your environment. The code is inside a compiled C standard library somewhere.

    Its "definition" is in the source code for your c standard library distribution. One such distribution is eglibc. This is browsable online, or in a source distribution:

    w_pow.c

    math_private.h

    Short answer: In the C standard library source code.

提交回复
热议问题