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 sqrtYou can also type:
man mathfor 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.
#include <math.h>This #include statement includes the proper declarations for the math library functions.
cc program.c -lmMake sure the -lm option is the last item on the line. A common mistake is to forget this option when compiling, which results in error messages informing you that the math functions are undefined.