Summary
When using multiple @editable floats that sum to 100 and some values have precision to the 4th or 5th decimal place, the equality check “if (Sum = 100.0):” fails. Although printing the sum shows it as 100.0, the comparison doesn’t work as expected. This appears to be caused by float precision errors.
Please select what you are reporting on:
Unreal Editor for Fortnite
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
- Define multiple @editable floats in your code with values that sum to 100.
- Set some of these floats to values with precision up to the 4th or 5th decimal place.
- Calculate the sum of these floats.
- Use an if statement to check if the sum is equal to 100.0 (e.g., “if (Sum = 100.0):” ).
- Print the sum for debugging purposes.
Expected Result
The condition “if (Sum = 100.0):” should evaluate to true if the sum of the floats is printed as exactly 100.0.
Observed Result
The condition “if (Sum = 100.0):” evaluates to false, even though printing the sum displays 100.0. This discrepancy suggests a float precision issue during the comparison.
Platform(s)
I’ve only tested this on PC so far.