Steps to Reproduce

Repeat the following process to check the log output

const int64 min = 1000000000;
const int64 max = 9999999999;
const int64 x = FMath::RandRange(min, max);
UE_LOG(LogTemp, Warning, TEXT("int64:%ld"), x); 

Output will be "-1147483648" with high probability (71 out of 100 times).

TruncToInt64() should be used in RandHelper64() instead of TruncToInt().

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-193898 in the post.

2
Login to Vote

Unresolved
ComponentUE - Foundation - Core
Affects Versions5.2
Target Fix5.6
CreatedAug 25, 2023
UpdatedOct 18, 2024
View Jira Issue