Hello you guys! I don't know why my compiler is giving me this error:
Code:
code.cpp(23) : error C2296: '^' : illegal, left operand has type 'float'
code.cpp(26) : error C2296: '^' : illegal, left operand has type 'float'
And here is the place where I get the error:
Code:
float Height(float G,float V, float S,int POSNEG)
{
      if(POSNEG == POSITIVE)
      {return(((-2*V)/(2*G)) + sqrt((-2*S)/(G)) + ((2*V^2)/(4*G))*2*G);}

      if(POSNEG == NEGATIVE)
      {return(((-2*V)/(2*G)) - sqrt((-2*S)/(G)) + ((2*V^2)/(4*G))*2*G);}

      else
      {
            return ERROR;
      }
}