From 51a8b814acb4ecf0f851fa89e2f480ac3672f1dd Mon Sep 17 00:00:00 2001 From: "J.M. Dana" Date: Sat, 3 Oct 2015 13:42:09 +0100 Subject: [PATCH] Divisions have been replaced by multiplications. --- DHT.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DHT.cpp b/DHT.cpp index 6431f1c..bdd8161 100644 --- a/DHT.cpp +++ b/DHT.cpp @@ -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);