Using the C MATH Library


There is a library of C functions called the mathematics library for performing many common math functions. There are functions such as sqrt, pow, sin, cos, sinh, tanh, etc. You can get a listing of the available functions by using the man command's -k option:
man -k 3M (or man -k 3m on the Sun workstations)
To learn more about any particular math function, again use the 'man' command to view the individual manual page. For example, to see the manual page for the sqrt function, type this:
man sqrt
You can also type:
man math
for a list of many available functions, as well as details about the mathematics behind them, and information on rounding errors, precisions, and so forth.

When using the math functions in your C program, you need to do two things.