Hi Ming-Xiang, Are you using C (gcc) or C++ (g++)? If you are using C, you are using #include <math.h>. If you are using C++, you should be using #include <cmath>. My advice is: don't use C header files in a C++ program. The C header file may define a macro, when what you really want is a C++ function. HTH, --Eljay