Bah, I just hadn't figured out the right search terms for the forum.
Defining the function as float from the beginning is the solution.
It's also in the manual, but I didn't quite grasp it until I tested it in action.
float blop()
{
return 0.14;
}
A very simple code example:
function blop()
{
return 0.14;
}
Produces error:
Type mismatch: cannot convert 'float' to 'int'
Is this a feature, or just a mistake on my part?
Is it not possible for a function to return a value in float?
Yes, this is because "function" is secretly an alias to "int", for backwards compatibility.
I had no idea that was the case, but now that you mention it, it makes perfect sense.
Thanks!