Skip to content

Commit ae60bb9

Browse files
committed
Fix missing header and std:: on math functions
1 parent d085d08 commit ae60bb9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugins/Satellites/src/OMMDateTime.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
1717
*/
1818

19+
#include <cmath>
1920
#include <QChar>
2021
#include <QDate>
2122
#include <QDebug>
@@ -45,11 +46,11 @@ OMMDateTime::OMMDateTime(const QString & s, Type t)
4546
// From SGP4.cpp
4647
static void jday_SGP4(int year, int mon, int day, int hr, int minute, double sec, double & jd, double & jdFrac)
4748
{
48-
jd = 367.0 * year - floor((7 * (year + floor((mon + 9) / 12.0))) * 0.25) + floor(275 * mon / 9.0) + day +
49+
jd = 367.0 * year - std::floor((7 * (year + std::floor((mon + 9) / 12.0))) * 0.25) + std::floor(275 * mon / 9.0) + day +
4950
1721013.5; // use - 678987.0 to go to mjd directly
5051
jdFrac = (sec + minute * 60.0 + hr * 3600.0) / 86400.0;
51-
if (fabs(jdFrac) > 1.0) {
52-
double dtt = floor(jdFrac);
52+
if (std::fabs(jdFrac) > 1.0) {
53+
double dtt = std::floor(jdFrac);
5354
jd = jd + dtt;
5455
jdFrac = jdFrac - dtt;
5556
}

0 commit comments

Comments
 (0)