UKismetMathLibrary::Conv_IntToInt64
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Widens a 32-bit integer to a 64-bit integer. Used as a Blueprint autocast when an Integer pin connects to an Integer64 input, and useful in C++ to avoid mixed-width arithmetic warnings.
Caveats & Gotchas
- • Sign extension is performed correctly — negative int32 values produce the corresponding negative int64 value, not a large positive number. If your logic assumes the result is always non-negative, add an explicit check.
- • Blueprint Integer64 nodes became fully supported in UE 4.22. In earlier engine versions this autocast did not exist and int64 manipulation required custom C++ nodes. If you maintain cross-version code, guard usage accordingly.
Signature
static UE_INL_API int64 Conv_IntToInt64(int32 InInt); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InInt | int32 | The 32-bit integer to widen. | — |
Return Type
int64 Example
Safe multiplication avoiding int32 overflow C++
int32 ItemCount = GetItemCount();
int32 ItemPrice = GetItemPriceInCents();
int64 TotalCents = UKismetMathLibrary::Conv_IntToInt64(ItemCount)
* UKismetMathLibrary::Conv_IntToInt64(ItemPrice); Tags
Version History
Introduced in: 4.22
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?