RealDocs

UKismetMathLibrary::Conv_DoubleToInt64

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

Description

Truncates a double to a 64-bit integer by discarding the fractional part. Equivalent to a C-style cast `(int64)InDouble`.

Caveats & Gotchas

  • Truncation, not rounding — 3.9 becomes 3, -3.9 becomes -3. If rounding is needed use FMath::RoundToInt64 or UKismetMathLibrary::Round64 before converting.
  • Doubles can represent values larger than int64's maximum (~9.2×10^18). Passing an out-of-range double produces undefined behaviour in C++; Blueprint autocast should be used only on values known to be in range.

Signature

static UE_INL_API int64 Conv_DoubleToInt64(double InDouble)

Parameters

Name Type Description Default
InDouble double The floating-point value to truncate to a 64-bit integer.

Return Type

int64

Example

Converting a world-space timestamp to integer ticks C++
double TimeSeconds = GetWorld()->GetTimeSeconds();
// Convert to microseconds as int64 for serialisation
int64 TimeMicros = UKismetMathLibrary::Conv_DoubleToInt64(TimeSeconds * 1e6);

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.