increase clarity of floating point usage

This commit is contained in:
2023-10-12 18:59:37 +01:00
parent c7c7d4e0ca
commit 4c7bb32e6f
2 changed files with 2 additions and 2 deletions

View File

@@ -60,7 +60,7 @@ float resistance_to_temperature(float r) {
float r_0 = 10000; float r_0 = 10000;
float b = 3975; float b = 3975;
return 1 / ( (1/t_0) + (1/b)*log(r/r_0)); return 1.0 / ( (1.0/t_0) + (1.0/b)*log(r/r_0));
} }

View File

@@ -72,7 +72,7 @@ float resistance_to_temperature(float r) {
float r_0 = 10000; float r_0 = 10000;
float b = 3975; float b = 3975;
return 1 / ( (1/t_0) + (1/b)*log(r/r_0)); return 1.0 / ( (1.0/t_0) + (1.0/b)*log(r/r_0));
} }