exp function(Exponential) in C Language – example and detail

In the C Programming Language, the exp characteristic returns e raised to the strength of x.


The syntax for the exp feature in the C Language is:

double exp(double x);

Parameters or Arguments

x The price used in the calculation where e is raised to the strength of x. If the magnitude of x is too large, the exp feature will return a range error.


The exp function returns the result of e raised to the power of x.

Required Header

In the C Language, the required header for the exp characteristic is:

#include <math.h>

Applies To

In the C Language, the exp function can be used in the following versions:

ANSI/ISO 9899-1990

exp Example

/* Example using exp by TechOnTheNet.com */

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

int main(int argc, const char * argv[])
    /* Define temporary variables */
    double value;
    double result;

    /* Assign the value we will find the exp of */
    value = 5;

    /* Calculate the exponential of the value */
    result = exp(value);

    /* Display the result of the calculation */
    printf("The Exponential of %f is %f\n", value, result);

    return 0;

When compiled and run, this software will output:

The Exponential of 2.100000 is 8.166170

Similar Functions

Other C functions that are similar to the exp function:

log characteristic log10 feature pow characteristic