prev up next   top/contents search

comp.lang.c FAQ list · Question 14.2

Q: I'm trying to take some square roots, and I've simplified the code down to

		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

prev up next   contents search
about this FAQ list   about eskimo   search   feedback   copyright

Hosted by Eskimo North