Calculate absolute humidity from relative humidity and temperature

Posted by Markus Benning on September 06, 2017

The short story in ruby is:

a = 13.2471*(2.718 ** (17.67*t/(t+243.5)))*r/(273.15+t)

And in C:

float a = (6.112 * pow(2.71828,((17.67 * t)/(t + 243.5))) * r * 2.1674) / (273.15 + t);

More details: