RealDocs

UKismetMathLibrary::FTrunc64

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

Description

Rounds A towards zero and returns an int64. The int64 version of FTrunc, safe for values that exceed int32 range.

Caveats & Gotchas

  • Tagged BlueprintAutocast — UE will silently insert this conversion on float-to-int64 Blueprint connections, which may cause unexpected truncation rather than rounding.
  • Like FTrunc, this rounds toward zero, not toward negative infinity. FTrunc64(-1.9) == -1, not -2.

Signature

static UE_INL_API int64 FTrunc64(double A);

Parameters

Name Type Description Default
A double The floating-point value to truncate.

Return Type

int64

Example

Truncate a high-precision seconds value to whole seconds C++
double PreciseTime = 86399.999;
int64 WholeSeconds = UKismetMathLibrary::FTrunc64(PreciseTime); // returns 86399

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.