fails to compile. i've tried using double as well as float variables. i'm
sure this is due to poor coding, but i'm looked at the man page and
linuxdoc.org and cannot find any example implementations of sqrt(). I'm
running i386 arch, and have math.h (as well as the complete gcc 3.0)
installed.

I doubt if this is your problem but on most compilers:
double num;
num = 4;

is inefficient; It normally causes an integer constant 4 to be stored
somewhere. Then when num = 4; is executed the integer 4 is converted
to double every you execute the code.

num = 4.;

is the normal way but you could even do use num = 4.L; in this case to
cause all of the conversion to occur at compile time.