Where are the implementations of the C libraries?

172 views Asked by At

I want to know how C library implements the sqrt() function. I got the header file math.h in /usr/include. But where is the actual implementation? I am doing a numerical computation project and would like to see the implementations of all the functions available in math.h.

1

There are 1 answers

6
Sourav Ghosh On

You'll have a generic answer for your query in this SO thread.

However, to be specific to this question, to get the math related functions, you need to search libm source code inside glibc. That is present in the directory named math.

An online browsable version is available here.