C Standard Library

C <math.h> - exp10() Function



The C <math.h> exp10() function returns 10 raised to the power of specified number, i.e., 10x.

Syntax

double exp10 (double x);
float exp10f (float x);
long double exp10l (long double x);

Parameters

x Specify the exponent of 10.

Return Value

Returns 10 raised to the power of specified number, i.e., 10x.

Example:

In the example below, exp10() function is used to calculate 10 raised to the power of specified number.

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

int main (){
  printf("%lf\n", exp10(2));
  printf("%lf\n", exp10(-2));
  printf("%lf\n", exp10(1.5));
  printf("%lf\n", exp10(-1.5));  
  return 0;
}

The output of the above code will be:

100.000000
0.010000
31.622777
0.031623

❮ C <math.h> Library