c++cmathcmathdefinitions

Definitions of sqrt, sin, cos, pow etc. in cmath


Are there any definitions of functions like sqrt(), sin(), cos(), tan(), log(), exp() (these from math.h/cmath) available ?

I just wanted to know how do they work.


Solution

  • This is an interesting question, but reading sources of efficient libraries won't get you very far unless you happen to know the method used.

    Here are some pointers to help you understand the classical methods. My information is by no means accurate. The following methods are only the classical ones, particular implementations can use other methods.