summaryrefslogtreecommitdiff
path: root/humidity.c
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-09-24 09:58:06 +0200
committerErich Eckner <git@eckner.net>2019-09-24 09:58:06 +0200
commit3c08c7f38cfb50b7dd0b53dd3ff84487cfbc4893 (patch)
tree93155e7ccd52c18054beb0ab44a7de0b92492d8a /humidity.c
parent5a5bb02d01fce26195cff8e78e2d106b770c6507 (diff)
downloadanzeige-3c08c7f38cfb50b7dd0b53dd3ff84487cfbc4893.tar.xz
humidity: repariert
Diffstat (limited to 'humidity.c')
-rw-r--r--humidity.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/humidity.c b/humidity.c
index 527492b..6aa1cfb 100644
--- a/humidity.c
+++ b/humidity.c
@@ -4,7 +4,11 @@ double maximale_luftfeuchte(double t)
{
for (int i=1; i<DAMPF_ANZ; i++)
if (dampf_temperaturen[i]>=t)
- return (t-dampf_temperaturen[i-1])*(dampf_feuchten[i]-dampf_feuchten[i-1])/(dampf_temperaturen[i]-dampf_temperaturen[i-1]);
+ return
+ (t - dampf_temperaturen[i-1])
+ * (dampf_feuchten[i] - dampf_feuchten[i-1])
+ / (dampf_temperaturen[i] - dampf_temperaturen[i-1])
+ + dampf_feuchten[i-1];
return -1;
}
@@ -12,6 +16,10 @@ double taupunkt(double af)
{
for (int i=1; i<DAMPF_ANZ; i++)
if (dampf_feuchten[i]>=af)
- return (af-dampf_feuchten[i-1])*(dampf_temperaturen[i]-dampf_temperaturen[i-1])/(dampf_feuchten[i]-dampf_feuchten[i-1]);
+ return
+ (af - dampf_feuchten[i-1])
+ * (dampf_temperaturen[i] - dampf_temperaturen[i-1])
+ / (dampf_feuchten[i] - dampf_feuchten[i-1])
+ + dampf_temperaturen[i-1];
return -1;
}