I'm not 100% sure on this, but it has something to do with the fact that pow is not defined for an interger base:
Code: Select all
double pow ( double base, double exponent );
long double pow ( long double base, long double exponent );
float pow ( float base, float exponent );
double pow ( double base, int exponent );
long double pow ( long double base, int exponent );
To me it seems like it should complain about the type of the base, but i guess it is trying to do some kind of implicit type conversion and can't figure out if it should convert to double or long double since both would work. By casting it to float, the only possibility there is, is to implicitly cast the exponent to a float too, and therefore there is no ambiguity.
This is just my guess though(with inspiration taken from the answer to the forum post i linked), I'm not sure if this is the correct explanation.