aboutsummaryrefslogtreecommitdiff
path: root/src/pj_math.c
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2018-04-22 22:39:57 +0200
committerKristian Evers <kristianevers@gmail.com>2018-04-23 10:26:14 +0200
commit6f640d76e13cb643574b44b7498d51ecff6fb83e (patch)
treeac17c997cf7efcea8854e3e1a616ede93ea07ebf /src/pj_math.c
parente197e40e9b9ae99b8dac569428af35036822dca2 (diff)
downloadPROJ-6f640d76e13cb643574b44b7498d51ecff6fb83e.tar.gz
PROJ-6f640d76e13cb643574b44b7498d51ecff6fb83e.zip
Add isnan() to proj_math.h
Code updated to use isnan() instead of pj_is_nan().
Diffstat (limited to 'src/pj_math.c')
-rw-r--r--src/pj_math.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pj_math.c b/src/pj_math.c
index d5242636..751c2750 100644
--- a/src/pj_math.c
+++ b/src/pj_math.c
@@ -61,6 +61,11 @@ double pj_asinh(double x) {
return x > 0 ? y : (x < 0 ? -y : x);
}
-#endif /* !(defined(HAVE_C99_MATH) && HAVE_C99_MATH) */
+/* Returns 0 if not a NaN and non-zero if val is a NaN */
+int pj_isnan (double x) {
+ /* cppcheck-suppress duplicateExpression */
+ return x != x;
+}
+#endif /* !(defined(HAVE_C99_MATH) && HAVE_C99_MATH) */