A
A
akobabkov2019-06-19 00:37:58
Python
akobabkov, 2019-06-19 00:37:58

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

3 answer(s)
L
longclaps, 2019-06-19
@akobabkov

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 .

R
Ronald McDonald, 2019-06-19
@Zoominger

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.

R
res2001, 2019-06-19
@res2001

https://tinyurl.com/y5dzwaah
If you are interested in the theoretical basis, buy a textbook on "numerical methods".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question