UKismetMathLibrary::MaxInt64
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the larger of A and B. Prefer this over a manual Greater_Int64Int64 branch when both values are already computed.
Caveats & Gotchas
- • Like MinInt64, no overflow handling is applied — if both inputs are INT64_MAX the result is INT64_MAX, which is correct, but subsequent addition will silently overflow.
- • When used to enforce a floor value, MaxInt64 can be paired with MinInt64 to clamp, but ClampInt64 is clearer and should be preferred for that pattern.
Signature
static UE_INL_API int64 MaxInt64(int64 A, int64 B); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | int64 | First value. | — |
| B | int64 | Second value. | — |
Return Type
int64 Example
Ensure a counter never goes below zero C++
int64 Counter = GetCounter() - 1;
Counter = UKismetMathLibrary::MaxInt64(Counter, 0LL); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?