exp()

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The exp() CSS function is an exponential function that takes an number as an argument and returns the mathematical constant e raised to the power of the given number.

The mathematical constant e represents Euler's number and is the base of natural logarithms, and is approximately 2.71828.

The function contains a calculation which returns the same value as pow(e, number).

Syntax

/* A <number> value */
width: calc(100px * exp(-1)); /* 100px * 0.367879441171442 = 36px */
width: calc(100px * exp(0));  /* 100px * 1 = 100px */
width: calc(100px * exp(1));  /* 100px * 2.718281828459045 = 217px */

Parameter

The exp(number) function accepts only one value as its parameter.

number

A calculation which resolves to a <number>. Representing the value to be raised by a power of e.

Return value

Returns a <number> which is the result of calculating e raised to the power of number.

Formal syntax

<exp()> = 
exp( <calc-sum> )

<calc-sum> =
<calc-product> [ [ '+' | '-' ] <calc-product> ]*

<calc-product> =
<calc-value> [ [ '*' | '/' ] <calc-value> ]*

<calc-value> =
<number> |
<dimension> |
<percentage> |
<calc-constant> |
( <calc-sum> )

<calc-constant> =
e |
pi |
infinity |
-infinity |
NaN

Specifications

Specification
Unknown specification
# exponent-funcs

Browser compatibility

BCD tables only load in the browser

See also