Answer the question
In order to leave comments, you need to log in
What does the source code for the sqrt function of the math (Python) library look like?
Specifically, I would like to see the algorithm, how the sqrt function does it all.
Answer the question
In order to leave comments, you need to log in
In the cpython sources, there is indeed a reference to the C-implementation of the standard mat. functions .
And in the x86/87 architecture, the sqrt function is implemented in hardware as a math coprocessor command .
Piston's math functions are a wrapper over Sishny, and how they are implemented there in a particular system - see the source code. Under Linux you will definitely find it, under Windows I don’t know.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question