UKismetMathLibrary::Subtract_DoubleDouble
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the difference of two doubles (A - B). This is the Blueprint 'float - float' subtraction node using double precision.
Caveats & Gotchas
- • Unlike integer subtraction, subtracting very close floating-point values can produce catastrophic cancellation — where significant digits are lost and relative error spikes. Use FMath::IsNearlyZero to check the result if precision matters.
- • The default value of B is 1.0, which makes it convenient for decrement patterns in Blueprint but can be surprising if called from C++ with only one argument.
Signature
static UE_INL_API double Subtract_DoubleDouble(double A, double B = 1.0); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | double | The minuend. | — |
| B | double | The subtrahend. | 1.0 |
Return Type
double Example
Calculate remaining health after damage C++
double CurrentHealth = 100.0;
double Damage = 35.0;
double Remaining = UKismetMathLibrary::Subtract_DoubleDouble(CurrentHealth, Damage); // 65.0 Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?