Calculating natural logarithm


This example demonstrates how to use the built-in natural logarithm (logf) function of SDCC.

Toolkit:SDCC 8051 Development System

Location:/bipom/devtools/sdcc/examples/math/log

Code Example


int main()
{
	float x;
	/* Set the serial port to 19200 Baud */
	serinit(CBR_19200);
	x = 1000.0;
	printf( "\n\rNatural Log of %6.2f is %6.2f", x, logf(x) );
	return 0;
}