Why do numeric transform values not stay what I input?

So many times I am putting very specific values in a static meshes transform vale through the UE4 UI (Objects details panel.)

Like I will input -180 for a rotation and UE4 will convert that number to -179.999893.

Why does this keep happening? This is driving my ocd self crazy!

Hey NickZucc-

What you are seeing is the approximations that floating point numbers use to represent a finite number. There are some cases where floating point numbers are unable to represent specific values (such as .1 or .01). In these instances the number is displayed as closely to the desired value as the system will allow.

Cheers

Thanks …but I’m entering some whole numbers like 90, 45, 180. Those values should hold. I wouldn’t really care but many times that field to see the number is so small that this really makes it a pain to see at a glance what the numbers are that you are working with.

Even when working with whole numbers, the way the computer interprets them is through conversions into binary. It is the conversion back and forth between standard numbers and binary (and back again) that causes the loss of accuracy. You may be able to use a “Floor” which will truncate the numbers after the decimal place or, if using a float for comparison, set the comparison to a small range rather than to an exact number.