Reference exp()

exp()

Calculates the value of Euler's number e (2.71828...) raised to the power of a number.

exp() can also be used in shaders with p5.strands. The following example uses exp() to create an accelerating color transition on a shape.

Examples

Syntax

exp(n)

Parameters

n
Number: exponent to raise.

Returns

Number: e^n
Notice any errors or typos? Please let us know. Please feel free to edit src/math/calculation.js and open a pull request!

Related References