math.h

Mathematics is relatively straightforward library to use again. You must #include and must remember to link in the math library at compilation: cc mathprog.c -o mathprog -lm A common source of error is in forgetting to include the file (and yes experienced programmers make this error also). Unfortunately the C compiler does not help much. Consider: double x; x = sqrt(63.9); ```Having not seen the prototype for sqrt the compiler (by default) assumes that the function returns an int and converts the value to a double with meaningless results. [Read More]