Where can I inspect Python's math functions?
问题 I would like to look at the way Python does computes square roots, so I tried to find the definition for math.sqrt() , but I can't find it anywhere. I have looked in _math.c , mathmodule.c , and elsewhere. I know that python uses C's math functions, but are these somewhere in the Python distribution, or are they linked to code elsewhere? I am using Mac OS X. Where is the algorithm in math.sqrt() ? 回答1: It depends on the implementation. CPython is using math functions from the standard C