RealDocs

UKismetMathLibrary::Conv_IntToDouble

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

Description

Widens an int32 to a double-precision float. Used implicitly by Blueprint's autocast system whenever an Integer pin feeds a Float/Double input.

Caveats & Gotchas

  • All int32 values convert to double exactly — double has 53 bits of mantissa, more than enough for 32-bit integers. However, if you later narrow the result back to float (32-bit), values above 2^24 (~16.7 million) lose precision.
  • This function replaced Conv_IntToFloat in UE 5.0 when Blueprint's float type was promoted to double. Blueprint graphs migrated automatically, but C++ callers that explicitly called Conv_IntToFloat may get a compiler deprecation warning on UE 5.x.

Signature

static UE_INL_API double Conv_IntToDouble(int32 InInt);

Parameters

Name Type Description Default
InInt int32 The integer to convert.

Return Type

double

Example

Compute a fractional score ratio C++
int32 Score = PlayerState->GetScore();
int32 MaxScore = 10000;
double Ratio = UKismetMathLibrary::Conv_IntToDouble(Score)
             / UKismetMathLibrary::Conv_IntToDouble(MaxScore);

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.