From 0f670f9ddd4ced2f8f6c1136372f27739711a975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Wed, 4 Dec 2019 22:19:00 +0100 Subject: [PATCH] A much nicer (and faster) 24b conversion --- src/common/garmin.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/garmin.h b/src/common/garmin.h index a68c99d0..380a4fe6 100644 --- a/src/common/garmin.h +++ b/src/common/garmin.h @@ -10,9 +10,7 @@ inline double toWGS32(qint32 v) inline double toWGS24(qint32 v) { - return (v < 0x800000) - ? (double)v * 360.0 / (double)(1U<<24) - : (double)(v - 0x1000000) * 360.0 / (double)(1<<24); + return toWGS32(v<<8); } #endif // GARMIN_H