Add casts to double to fix compilation on ARM

These were needed to get qgis building on ARM on Fedora.