Hey all, I would like to ask you guys to try and do this math in UE4:
2458149 + (68.7/86400) = 2458149.000795139
However when I do it, I get only 2458149. Where are my decimals? Is it limited or something? Does anyone know why it does that? When I did (68.7/86400), I got the decimals I wanted, 0.000795139, but when i added the 2458149, it outputs just the 2458149. Hope someone knows whats up!
Yeah they are all floats, and actually I have a lot more problems adding, dividing etc of huge numbers with huge decimal places. Sometimes when I type in a 9 digit number, the editor will always revert to a smaller number, as if there is a cap on it.
there are limits on floats. I dont know the limits specifically implemented in unreal but usually theres a limit on how high of value or how many decimal places. in this case it may just be a limit to how many numbers you can use. Floats were never really meant to be used for huge numbers thats why theres integers.
This is the correct answer. To clarify, “floating-point precision” refers to the fact that the larger a number is, the fewer decimal places will be accounted for. Go to IEEE 754 Calculator and click “binary32” at the bottom of the page (for float instead of double), and then try your math problem. You’ll see that this is a limitation of the float data type itself.