Q: I'm trying to take some square roots, and I've simplified the code down to
main() { printf("%f\n", sqrt(144.)); }but I'm still getting crazy numbers.
A: Make sure that you have #included <math.h>, and correctly declared other functions returning double. (Another library function to be careful with is atof, which is declared in <stdlib.h>.) See also questions 1.25, 14.3, and 14.4a.
References:
CT&P Sec. 4.5 pp. 65-6