What is expl() in C?

We use the expl() function – a variation of exp() – to compute e raised to the power of x for long double in C.

Mathematical representation

Library

#include<math.h>

Syntax

Below is the declaration of the expl() function:

long double expl(long double x);

Here, x is a long double exponent passed as the parameter to the function.

The function returns e raised to the power of x as a long double value.

Code

#include <math.h>
#include <stdio.h>
int main()
{
long double var1;
long double var2;
var1 = 4.5;
var2 = -1.3;
printf("e^4.5 = %Lf", expl(var1)); //Calculates e^4.5
printf("\ne^-1.3 = %Lf", expl(var2)); //Calculate e^-1.3
return 0;
}

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved