A licensee reported a bug in rounding of a call to FJsonValue::TryGetNumber(int64&) with large values. In investigating this, it appears that equivalent problems also exist in FMath:: rounding functions.
double DVal = 4580814166857753.0; FMath::RoundHalfFromZero(DVal); // 4580814166857754.0 - wrong FMath::RoundHalfToZero(DVal); // 4580814166857752.0 - wrong std::llround(DVal) // 4580814166857753.0 - right FJsonValueNumber JsonVal(DVal); int64 IntVal; ((FJsonValue&)JsonVal).TryGetNumber(IntVal); // 4580814166857754.0 - wrong
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-71305 in the post.
0 |
Component | UE - Foundation - Core |
---|---|
Affects Versions | 4.22 |
Target Fix | 4.23 |
Fix Commit | 5369636 |
---|
Created | Mar 8, 2019 |
---|---|
Resolved | Jan 11, 2021 |
Updated | Apr 28, 2021 |