64/32 bit float issue

(Ron) #1

It seems the Mac saves property floats as 64 bit numbers and the windows build saves them as 32 bit floats.

On the mac:

<properties>
    <property name="odds" type="float" value="0.050000000000000003"/>
</properties>

On windows:

<properties>
    <property name="odds" type="float" value="0.05"/>
</properties>

Normally this wouldn’t matter, but in version control these lines keep showing up as changed depending on which machine opened them last.

I could be wrong about 32 vs 64 being the cause, but they are saved differently for some reason.

(Thorbjørn Lindeijer) #2

Indeed this does not appear to be a 32 vs. 64 bit problem, since the values are doubles both on macOS and Windows. However, there is a difference affecting the conversion of doubles to strings between Qt 5.6 (used for the macOS release) and Qt 5.9 (used on Windows).

The “snapshot” releases are currently all done against Qt 5.9, including macOS. So if you use those you should not have this problem.