Changeset View
Changeset View
Standalone View
Standalone View
kmplot/view.cpp
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | |||||
93 | #include <nan.h> | 93 | #include <nan.h> | ||
94 | #define isnan(x) IsNAN(x) | 94 | #define isnan(x) IsNAN(x) | ||
95 | #define isinf(x) IsINF(X) | 95 | #define isinf(x) IsINF(X) | ||
96 | #endif | 96 | #endif | ||
97 | 97 | | |||
98 | #ifdef Q_OS_SOLARIS | 98 | #ifdef Q_OS_SOLARIS | ||
99 | int isinf(double x) | 99 | int isinf(double x) | ||
100 | { | 100 | { | ||
101 | return !finite(x) && x==x; | 101 | return !std::isfinite(x) && x==x; | ||
102 | } | 102 | } | ||
103 | #endif | 103 | #endif | ||
104 | // only msvc needs this (sometimes) | 104 | // only msvc needs this (sometimes) | ||
105 | #ifdef _MSC_VER | 105 | #ifdef _MSC_VER | ||
106 | #ifndef KDEWIN_VERSION | 106 | #ifndef KDEWIN_VERSION | ||
107 | int isinf(double x) | 107 | int isinf(double x) | ||
108 | { | 108 | { | ||
109 | return !finite(x) && x==x; | 109 | return !std::isfinite(x) && x==x; | ||
110 | } | 110 | } | ||
111 | #endif // KDEWIN_VERSION | 111 | #endif // KDEWIN_VERSION | ||
112 | #endif //END _WIN32 | 112 | #endif //END _WIN32 | ||
113 | //END nan & inf | 113 | //END nan & inf | ||
114 | 114 | | |||
115 | 115 | | |||
116 | // does for real numbers what "%" does for integers | 116 | // does for real numbers what "%" does for integers | ||
117 | double realModulo( double x, double mod ) | 117 | double realModulo( double x, double mod ) | ||
▲ Show 20 Lines • Show All 182 Lines • ▼ Show 20 Line(s) | 298 | { | |||
300 | return; | 300 | return; | ||
301 | } | 301 | } | ||
302 | 302 | | |||
303 | 303 | | |||
304 | //BEGIN get X/Y range | 304 | //BEGIN get X/Y range | ||
305 | m_xmin = XParser::self()->eval( Settings::xMin() ); | 305 | m_xmin = XParser::self()->eval( Settings::xMin() ); | ||
306 | m_xmax = XParser::self()->eval( Settings::xMax() ); | 306 | m_xmax = XParser::self()->eval( Settings::xMax() ); | ||
307 | 307 | | |||
308 | if ( m_xmax <= m_xmin || !finite(m_xmin) || !finite(m_xmax) ) | 308 | if ( m_xmax <= m_xmin || !std::isfinite(m_xmin) || !std::isfinite(m_xmax) ) | ||
anthonyfieroni: As a suggest, first check for finite then make comparison. | |||||
309 | { | 309 | { | ||
310 | m_xmin = -8; | 310 | m_xmin = -8; | ||
311 | m_xmax = +8; | 311 | m_xmax = +8; | ||
312 | } | 312 | } | ||
313 | 313 | | |||
314 | m_ymin = XParser::self()->eval( Settings::yMin() ); | 314 | m_ymin = XParser::self()->eval( Settings::yMin() ); | ||
315 | m_ymax = XParser::self()->eval( Settings::yMax() ); | 315 | m_ymax = XParser::self()->eval( Settings::yMax() ); | ||
316 | if ( m_ymax <= m_ymin || !finite(m_ymin) || !finite(m_ymax) ) | 316 | if ( m_ymax <= m_ymin || !std::isfinite(m_ymin) || !std::isfinite(m_ymax) ) | ||
317 | { | 317 | { | ||
318 | m_ymin = -8; | 318 | m_ymin = -8; | ||
319 | m_ymax = +8; | 319 | m_ymax = +8; | ||
320 | } | 320 | } | ||
321 | //END get X/Y range | 321 | //END get X/Y range | ||
322 | 322 | | |||
323 | 323 | | |||
324 | //BEGIN calculate scaling matrices | 324 | //BEGIN calculate scaling matrices | ||
▲ Show 20 Lines • Show All 3949 Lines • Show Last 20 Lines |
As a suggest, first check for finite then make comparison.