Doing a sum with the first column being a FLOAT or DOUBLE will return a DECIMAL with a fixed scale of 4.
Doing any multiplication or division will also result in a DECIMAL with scale 4.
I propose that the return value should either:
-always be DECIMAL with appropriate scale
-match the metadata of the first column