0.5 is of type double. The float version is 0.5f, this goes for all literals