From 6f640d76e13cb643574b44b7498d51ecff6fb83e Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sun, 22 Apr 2018 22:39:57 +0200 Subject: Add isnan() to proj_math.h Code updated to use isnan() instead of pj_is_nan(). --- src/pj_math.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/pj_math.c') 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) */ -- cgit v1.2.3