UKismetMathLibrary::Round64
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPureUFUNCTION
Description
Rounds A to the nearest integer and returns an int64. -1.6 becomes -2 and 1.6 becomes 2. Use when the result may exceed int32 range.
Caveats & Gotchas
- • Blueprint exposes this as 'Round to Integer64' to distinguish it from the int32 Round node. Using the wrong node in a large-number context (e.g., game time in milliseconds) will silently overflow.
- • Doubles have only 53 bits of integer mantissa, so Round64 loses precision for values beyond ~9 quadrillion even though int64 can represent larger numbers.
Signature
static UE_INL_API int64 Round64(double A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | double | The floating-point value to round. | — |
Return Type
int64 Example
Round a high-precision timestamp to the nearest millisecond C++
double TimeMs = 12345678.6;
int64 RoundedMs = UKismetMathLibrary::Round64(TimeMs); // returns 12345679 Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?