From 25e86b84a5b3dcd6ecbc599865786511d718efb2 Mon Sep 17 00:00:00 2001 From: A-j-K Date: Mon, 10 Jul 2023 23:33:47 +0100 Subject: [PATCH] Fix missing header and std:: on math functions --- plugins/Satellites/src/OMMDateTime.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/Satellites/src/OMMDateTime.cpp b/plugins/Satellites/src/OMMDateTime.cpp index 58740c55edc18..37dde41a576eb 100644 --- a/plugins/Satellites/src/OMMDateTime.cpp +++ b/plugins/Satellites/src/OMMDateTime.cpp @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. */ +#include #include #include #include @@ -45,11 +46,11 @@ OMMDateTime::OMMDateTime(const QString & s, Type t) // From SGP4.cpp static void jday_SGP4(int year, int mon, int day, int hr, int minute, double sec, double & jd, double & jdFrac) { - jd = 367.0 * year - floor((7 * (year + floor((mon + 9) / 12.0))) * 0.25) + floor(275 * mon / 9.0) + day + + jd = 367.0 * year - std::floor((7 * (year + std::floor((mon + 9) / 12.0))) * 0.25) + std::floor(275 * mon / 9.0) + day + 1721013.5; // use - 678987.0 to go to mjd directly jdFrac = (sec + minute * 60.0 + hr * 3600.0) / 86400.0; - if (fabs(jdFrac) > 1.0) { - double dtt = floor(jdFrac); + if (std::fabs(jdFrac) > 1.0) { + double dtt = std::floor(jdFrac); jd = jd + dtt; jdFrac = jdFrac - dtt; }