The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
We recommend using Visual Studio 2017

# exp, expf

Visual Studio 2015

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at exp, expf, expl.

Calculates the exponential.

## Syntax

```double exp(
double x
);
float exp(
float x
);  // C++ only
long double exp(
long double x
);  // C++ only
float expf(
float x
);

```

#### Parameters

`x`
Floating-point value.

## Return Value

The `exp` function returns the exponential value of the floating-point parameter, `x`, if successful. That is, the result is e to the power `x`, where e is the base of the natural logarithm. On overflow, the function returns INF (infinite) and on underflow, `exp` returns 0.

InputSEH ExceptionMatherr Exception
± QNAN,INDNone_DOMAIN
± ∞INVALID_DOMAIN
x ≥ 7.097827e+002INEXACT+OVERFLOWOVERFLOW
X ≤ -7.083964e+002INEXACT+UNDERFLOWUNDERFLOW

`exp` has an implementation that uses Streaming SIMD Extensions 2 (SSE2). See _set_SSE2_enable for information and restrictions on using the SSE2 implementation.

## Remarks

C++ allows overloading, so you can call overloads of `exp`. In a C program, `exp` always takes and returns a double.

## Requirements

`exp`, `expf`<math.h>

For additional compatibility information, see Compatibility in the Introduction.

## Example

```// crt_exp.c

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

int main( void )
{
double x = 2.302585093, y;

y = exp( x );
printf( "exp( %f ) = %f\n", x, y );
}

```
```exp( 2.302585 ) = 10.000000

```

## .NET Framework Equivalent

System::Math::Exp