C Reference function exp()

Usage of exp():

double exp(double x);

Parameters:

There is no range limit on the argument.

Return value:

There is no range limit on the return value.

Source code example of exp():


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

	main()
	{
		double input, output;
		input = 2.0;
		output = exp (input);
		printf ("Exponential value of %lf is %lf.\n", input, output);
		return 0;
	}

Output of the exp example program above:


	Exponential value of 2.000000 is 7.389056

This entry was posted in C Reference math.h Functions. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed. Tweet This! Tweet This! or use to share this post with others.

There are currently 2 responses to “C Reference function exp()”

Why not let us know what you think by adding your own comment!

  1. karthikeyan on March 5th, 2010:

    this exp fun’s aren’t working in gcc compilers………..

  2. admin on March 5th, 2010:

    @karthikeyan

    This is not true!
    You probably get the following error: ERROR: Undefined symbol: .exp

    The solution is that you are forgetting to link the math library during compilation, to link the math lib use “-lm”.
    For example: gcc exptest.c -o exptest -lm

    Than it should work, good luck!