What is the "to the power of" symbol in objective-c

user1930931 picture user1930931 · Dec 28, 2012 · Viewed 18.1k times · Source

For the program I am making, I need the to power of symbol, but when I try to use the general symbol (^), it doesn't recognize that?

Could anyone tell me what symbol to use instead?

Answer

Daij-Djan picture Daij-Djan · Dec 28, 2012

there is no pow symbol. use the C function pow(x,y);

double res = pow(5.0,2.0); //25  

BSD Library Functions Manual

NAME: pow -- power function

SYNOPSIS:

 #include <math.h>

 double pow(double x, double y);