RealDocs

UKismetMathLibrary::Divide_DoubleDouble

function Engine Blueprint Since 5.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Returns the quotient of two doubles (A / B). Division by zero produces positive or negative infinity per IEEE 754.

Caveats & Gotchas

  • Unlike integer division (Divide_IntInt), dividing by zero does NOT crash or log a warning — it silently returns +/-Inf or NaN per IEEE 754. Always guard B != 0 if the divisor is user-supplied or calculated.
  • The engine has a separate ReportError_Divide_DoubleDouble helper that Blueprint's custom thunk can invoke for script-level divide-by-zero logging, but the static C++ function itself has no such guard.

Signature

static UE_INL_API double Divide_DoubleDouble(double A, double B = 1.0);

Parameters

Name Type Description Default
A double The dividend.
B double The divisor. 1.0

Return Type

double

Example

Normalise a value to a 0-1 range C++
double Value = 75.0;
double MaxValue = 100.0;
if (MaxValue != 0.0)
{
    double Normalized = UKismetMathLibrary::Divide_DoubleDouble(Value, MaxValue); // 0.75
}

Tags

Version History

Introduced in: 5.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.