Can anyone tell me if the implementation of functions of cmath library is in binary or C?
Last edited on
Math.h is a header file. Thus, it is written in C. Also, this forum is for C++.
@TheToaster
C++ is a proper superset of C. I see no reason why C-related questions would be unwelcome here.
@shubham1355
New thread for the same question? Or are we following an X-Y problem? (What is is you are really trying to do?)
@Ganado
That example is just the C-to-assembly interface for using the processor sqrt function over doubles.
Every compiler vendor will generally provide assembly routines for math functions on the architectures it compiles for. Some functions, like cube root, are unlikely to have a direct processor instruction to compute, necessitating a simple, tight assembly routine. Everything else will, as you posted, simply have a small function that simply frobs the assembler.
Sorry, but did I claim it was something else? Maybe my terminology was incorrect.
The directory I posted has many other assembly examples, btw (view with dutch's link)
Last edited on