Skip to content

Commit

Permalink
Divisions have been replaced by multiplications.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdana committed Oct 3, 2015
1 parent 36fb162 commit 51a8b81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DHT.cpp
Expand Up @@ -109,10 +109,10 @@ float DHT::computeHeatIndex(float temperature, float percentHumidity, bool isFah
-0.00000199 * pow(temperature, 2) * pow(percentHumidity, 2);

if((percentHumidity < 13) && (temperature >= 80.0) && (temperature <= 112.0))
hi -= ((13.0 - percentHumidity) / 4.0) * sqrt((17.0 - abs(temperature - 95.0))/17.0);
hi -= ((13.0 - percentHumidity) * 0.25) * sqrt((17.0 - abs(temperature - 95.0)) * 0.05882);

else if((percentHumidity > 85.0) && (temperature >= 80.0) && (temperature <= 87.0))
hi += ((percentHumidity - 85.0) / 10.0) * ((87.0 - temperature)/5.0);
hi += ((percentHumidity - 85.0) * 0.1) * ((87.0 - temperature) * 0.2);
}

return isFahrenheit ? hi : convertFtoC(hi);
Expand Down

0 comments on commit 51a8b81

Please sign in to comment.