double pow() question

float a,b,c,d;
double z;
how would i use the pow function to have
z = ((a to the power of b)/(c to the power of d))
z = std::pow(a,b) / std::pow(c, d);
oh ok, also , if its like this pow (p * (a * y), b) , will the exponent be for (a*y) or the whole equation?
what do you see in your compiler
pow takes 2 arguments: base and exponent. Everything passed to the first parameter will be base and everything passed to the second will be exponent.
So:
1
2
3
4
pow(
    p * (a * y), //←base
    b            //←exponent
                 ) 

Expression p * (a * y) would be calculated first and the result will be used as a base.
so how would i have (a*y) have the exponent only
Do not pass p as part of first parameter.
std::pow(a*y, b)
so would this be valid p* pow(a*y,b)
Yes
Topic archived. No new replies allowed.