what is wrong with the log function in c?

Hi I looked up the reference but couldn't figure out whats wrong with my log funtions in ANSI C, need this log functions for a memory compiler, please help!!

#include <stdio.h>
#include <math.h>

int main(void)
{

double d ;

double logB(double x, double base);

printf(" natural log :\n");
for ( d = 1; d <= 10; d++)
printf(" ln(%f) = %f\n", d, log(d));

printf("\n\n\n 2base log :\n");
for ( d = 1.0; d <= 10.0; d++)
printf(" log2(%f) = %f\n", d, logB(d, 2));

return 0;
}

double logB(double x, double base) {
return( log(x) / log(base));
}

Have you compiled the program with the -lm option?

cc program.c -o program -lm

Regards

that works, thank you very much!!