ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all!
ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all!
ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all!
ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all!
ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all!
ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all!
ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all!
ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all!
Menu
Front page
Memberlist
Sign up

 
Log in



New profiles
hari
nichtssagend
zithromax
ven
Edwin

Partners & Sponsors
Rockwave Hyves
FlabberM
Festivalinfo
Goedkopewebhosting
Sitix Ontwerpbureau
Custom Stores
log function
Related library: math.h

The log function returns the natural logarithm (base e) of number.

Usage
double log(double number)

Input Parameters
double number

Where number is the number that will be calculated.

Return Value
The log function returns the logarithm of number.

If number is negative, log will return NAN and will set errno to EDOM.
If number is 0, log will return -INFINITY and will set errno to EDOM.
If number is NAN, log will return NAN.
If number is INFINITY, log will return INFINITY.

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

int main()
{
 double input;
 double output;

 printf("Please enter a double: ");
 scanf("%lf", &input);

 if(input <= 0)
 {
  printf("Logarithm does not return an integer for numbers <= 0");
  return 1;
 }

 output = log(input);

 printf("The logarithm of %f is %f\n", input, output);

 return 0;
}

History
We have no records of the history of this function. Know a source? Contact us.

Notes and Warnings
Understanding the Example Code

  1. Ask user for a number.
  2. Check if the number is less than or equal to 0. If so, send an error.
  3. Find the logarithm of the number, and output the results.

Example Runs
Please enter a double: 1
The logarithm of 1.000000 is 0.000000

Please enter a double: 2.71828183
The logarithm of 2.718282 is 1.000000

Please enter a double: -1
Logarithm does not return an integer for numbers <= 0




Er zijn nog geen reacties geplaatst!
Je bent niet ingelogd! Meld je hier aan of log je aan de rechterkant in!
ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all!
ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all!
ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all! ANSI C dot NET - C programming, C functions, C tutorials, function summary... we have it all!