Code trouble

I have a formula for figuring out relitive humidity but it will not compile the trouble is the double **

es= 6.11 * 10.0**(7.5*tc/(237.7+tc))

how do I enter in gcc format...??
thanks
Eldon

Assuming you mean C, and
according to this article it should be

#include <math.h>

es= 6.11 * pow( 10.0, (7.5*tc/(237.7+tc)) );

Also consult the man page

man pow
1 Like

/home/eldon/wthrbase/src/wthrbase.c:929:15: error: too few arguments to function �pow'
this is the error

You probably didn't put enough options into pow. Please show the exact code you used.

es = 6.11 * pow(10.0 * (7.5 * c/ (237.7 + c)));

thanks

Change:

es = 6.11 * pow(10.0 *  (7.5 * c/ (237.7 + c)));

to:

es = 6.11 * pow(10.0, (7.5 * c/ (237.7 + c)));

or:

es = 6.11 * pow(10.0, 7.5 * c/ (237.7 + c));
1 Like

that did it!!!!! thanks lots all of you.
Eldon

2 Likes