From d5a0184f71d64705f8f35cc42636b82542257e88 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 7 Oct 2017 13:32:54 -0700 Subject: 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 Signed-off-by: Dirk Hohndel --- core/parse-xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') 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; -- cgit v1.2.3-70-g09d2