Share via


log, log10 (Windows CE 5.0)

Send Feedback

Developing an Application > Microsoft C Run-time Library for Windows CE > Run-time Library Reference

Calculates logarithms.

double log(    doublex);double log10(    doublex );

Parameters

  • x
    Value whose logarithm is to be found.

Return Values

The log functions return the logarithm of x if successful.

If x is negative, these functions return an indefinite (same as a quiet NaN).

If x is 0, they return INF (infinite).

Example

/* LOG.C: This program uses log and log10
 * to calculate the natural logarithm and
 * the base-10 logarithm of 9,000.
 */


void main( void )
{
   double x = 9000.0;
   double y;

   y = log( x );
   printf( "log( %.2f ) = %f\n", x, y );
   y = log10( x );
   printf( "log10( %.2f ) = %f\n", x, y );
}

Output

log( 9000.00 ) = 9.104980
log10( 9000.00 ) = 3.954243

Requirements

OS Versions: Windows CE 2.0 and later.
Header: stdlib.h.
Link Library: coredll.dll.

See Also

exp | pow

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.