UKismetMathLibrary::Exp
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns e raised to the power A (e^A). Commonly used for exponential decay, easing curves, and probability distributions.
Caveats & Gotchas
- • Large positive inputs (A > ~709) overflow to infinity on IEEE 754 doubles, which can crash or corrupt physics simulations if unchecked.
- • For game-logic exponential decay over time (e.g. smooth follow), FMath::Lerp with a per-frame alpha is often more stable than computing Exp(-k * DeltaTime) every tick.
Signature
static UE_INL_API double Exp(double A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | double | The exponent to raise e to. | — |
Return Type
double Example
Exponential decay (smooth damping) C++
// Smoothly reduce a value toward zero each tick
double DecayRate = 2.0;
CurrentValue *= UKismetMathLibrary::Exp(-DecayRate * DeltaTime); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?