Announcement

Collapse
No announcement yet.

Float maximum value limitation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [BLUEPRINT] Float maximum value limitation

    Hi all,

    I'm opening this thread because I'm calculating some numbers with Unreal and I have seen that, when you reach the number 16777269.0 in a float, it goes back to 16777268.0. That's the first number with this behaviour, but it happens in a lot of more numbers above that one.

    How to check it (really easy):
    1. Create a blueprint with a variable of float type.
    2. Make the variable Instance Editable
    3. Place the blueprint in the World and change the variable value to 16777269.0
    4. Notice that it goes back to 16777268.0

    Thank you and best regards
    RTX RayTracing easy global settings tweaker

    Advanced HDRi background tool + 64 HDR images

    #2
    Look into floating point precision. You see this kind of stuff a lot when you're working with large or really small numbers. Doing something simple like 2f+3f will give you answers like 5.000000003. This is one of the key reasons why they don't recommend making worlds above 5-6km, without using origin rebasing, because you'll end up with issues like that...
    Last edited by IronicParadox; 07-29-2019, 06:29 PM.

    Comment

    Working...
    X