18

I have this:

    float xExponential = pow(xPingPong, 5);

And is not working, claiming:

ERROR: 0:53: No matching overload for call to function 'pow'

Am I doin' something wrong? Developing for iOS with OpenGL ES 2.0.

Geri Borbás
  • 15,810
  • 18
  • 109
  • 172

2 Answers2

53

Can you try this ?

float xExponential = pow(xPingPong, 5.0);
Mennan
  • 4,451
  • 13
  • 54
  • 86
  • 18
    Reason is that 5 is a integer and 5.0 is a float (and the pow function is not defined for pow(float,int). There is no automatically typecast in GLSL, but you could force the correct type by float xExponential = pow(xPingPong, float(5)); - not that it makes sense in this example. – Mortennobel May 06 '12 at 16:27
  • 7
    @Geri It's considered polite to accept an answer if it helped you solve your problem. Hit the checkmark beside Mennan's answer if it helped you. – Engineer Jan 14 '14 at 21:18
2

Your code is fine just syntax error

Write upto decimal digit

 float xExponential = pow(xPingPong, 5.0);

or

 float xExponential = pow(xPingPong, 5.);
Neeleshwar Kumar
  • 335
  • 3
  • 13