diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-10-07 13:32:54 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-10-07 14:52:57 -0700 |
commit | d5a0184f71d64705f8f35cc42636b82542257e88 (patch) | |
tree | 5d030b7b709e2f70cd007dc8891ad8e036989889 /core/parse-xml.c | |
parent | 03b10383c9c0e48922fa8d8e419c9c75881dbecd (diff) | |
download | subsurface-d5a0184f71d64705f8f35cc42636b82542257e88.tar.gz |
Fix divinglog import temperature truncation
The code incorrectly divided the temperature by 10 as an integer,
causing unnecessary precision loss due to truncation.
Fix it, and update the test results for the now improved temperature
import.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/parse-xml.c')
-rw-r--r-- | core/parse-xml.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/parse-xml.c b/core/parse-xml.c index 303f974ed..d69545550 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -3294,7 +3294,7 @@ extern int divinglog_profile(void *handle, int columns, char **data, char **colu int tank = atoi_n(ptr2+7, 1); int rbt = atoi_n(ptr2+8, 3) * 60; - cur_sample->temperature.mkelvin = C_to_mkelvin(temp / 10); + cur_sample->temperature.mkelvin = C_to_mkelvin(temp / 10.0f); cur_sample->pressure[0].mbar = pressure * 100; if (oldcyl != tank) { struct gasmix *mix = &cur_dive->cylinder[tank].gasmix; |