How can i input this formula into my c++ program? -



How can i input this formula into my c++ program? -

wind chill = 35.74 + 0.6215t - 35.75(v^0.16) + 0.4275t(v^0.16)

i need right way input above formula program. have next , it's giving me crazy number:

windchill = ((35.74 + (0.6215 * temperature)) - (35.75 * pow(windspeed, 0.16)) + (0.4275 * temperature * pow(windspeed, 0.16)));

i beginner programmer, c++ first language learning appreciate , help. give thanks you.

you can simplify removing parenthesis.

double wind_chill = 35.74 + 0.6215 * t - 35.75 * pow(v, 0.16) + 0.4275 * t * pow(v, 0.16);

but in case calculate powerfulness 2 times. improve way :

double pow_v = pow(v, 0.16); double wind_chill = 35.74 + 0.6215 * t - 35.75 * pow_v + 0.4275 * t * pow_v;

c++ formula

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -