> insert #include <cmath> or <math.h> depending on what 
> language your using

Also, for mathematical functions, you need to link in the 
math library when you compile:

  gcc [your flags] -lm myprog.c

The -lm is fed to the link-loader (ld) at link time. I've 
never understood why this should be necessary; other 
libraries get linked in automatically as required. Is there 
something special about the math library that it needs to be 
mentioned explicitly?

This is a common pitfall on Unix-like systems.

David

Reply via email to