This question already has answers here:
How is the square root function implemented? [closed]
(15 answers)
Closed 8 years ago.
How does sqrt function really work ? Does it go by any logical theorem to get the result.
Is there any way i can access the code of libarary function such as sqrt?
You can download the source code from the libc, which is open source: http://www.gnu.org/software/libc/download.html
Related
This question already has answers here:
2 to the power of N in C without pow
(2 answers)
The most efficient way to implement an integer based power function pow(int, int)
(21 answers)
Closed 1 year ago.
I want to do a pretty simple calculation: 2^20, but I don't have the library math.h.
How can I do it in the kernel space?
This question already has answers here:
getting free unit number in fortran
(2 answers)
Closed 7 years ago.
I can write a FORTRAN function to find an available file unit, but I was certain there was already an intrinsic. But if there is, I can't find anything about it. Is there such a thing or am I dreaming?
UPDATE: Apologies for the duplicate. Did a search, but it didn't show up.
I guess, you are looking for newunit (available with F2008, shown at the bottom of that link in the Fortran Wiki).
Ups, has already been answered.
maybe you were thinking of inquire?
This question already has answers here:
How does C compute sin() and other math functions?
(22 answers)
Closed 9 years ago.
Anybody can explain or show how is the function "sin" (or "sinf", "sinl") realized in C.
Intuition suggests that it should be somewhere in the math.h but I did not see anything there
There's a couple ways I can think of right off the bat:
Lookup tables
Approximation via Taylor series (which can be easily made accurate to a number of significant digits).
This question already has answers here:
Quicksort implementation in C?
(1 answer)
What sorting algorithm does qsort use?
(3 answers)
Closed 9 years ago.
Silly question perhaps, but is there any guarantee that the qsort() routine in the C standard library really implements the QuickSort algorithm?
Since there is nothing in the standard that nominates QuickSort specifically, no.
This question already has answers here:
What does 'sizeof (function name)' return?
(4 answers)
Closed 10 years ago.
I tried sizeof(printf) , sizeof(foobar) etc. where foobar is a user defined function. It returns 1 without any warning or error. Why 1?
The size of functions is not well defined in C, so the value is meaningless.