原型:extern float log(float x);
用法:#include <math.h>
功能:计算x的自然对数。
说明:x的值应大于零。
举例:// log.c #include <syslib.h> #include <math.h> main() { float x; clrscr(); // clear screen textmode(0x00); // 6 lines per LCD screen printf("ln(e)=%f\n", log(M_E)); // M_E is 2.71828..., defined in math.h getchar(); return 0; }相关函数:log10