Min of Float Array Problem UE 5.0 and 5.1

I upgraded my project from 4.27 to 5 and notice a very weird issue with the node of Min of Float Array cannot accurately retrieve the exact min value in a float array.

As the screenshots below show, the correct min should be 749.733286, the retrieved min turns out to be 749.733276


01

Shouldn’t the index come from here?

No, I am checking if the min float value can be found in the map. It turns out the min float retrieved from the map keys does not match the one stored in the map.

Ok, I’m with you :slight_smile:

Rounding error of some sort? It is a bit weird…

Imo Its not a good idea to use floats as keys. Precision errors will make exact comparisons unpredictable.

1 Like

@pezzott1 I was not aware of that issue when working in UE4. Now I will have to be more cautious with using floats as keys. Not sure why there is such a change from UE4 to 5.

1 Like

Yes, always assume floats are approximate, not exact :slight_smile:

I think the fact is in UE5 the default float is double precision, so I guess in Vertex Distances the float should be double precision. But the Min of Float Array function can only accept the array of single precision, there will be accuracy loss in this step. So the output Min Value is not accurate.