summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-26 13:55:49 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-26 13:55:49 -0600
commitc12007d0bb7aafb7f44efd131414dd7a88082468 (patch)
treec1a7471215e5eee803073ed15360c509a64cc87a
parentb2a5143a51f471f61c1a967a9aceb765260e466b (diff)
downloadnuttx-c12007d0bb7aafb7f44efd131414dd7a88082468.tar.gz
nuttx-c12007d0bb7aafb7f44efd131414dd7a88082468.tar.bz2
nuttx-c12007d0bb7aafb7f44efd131414dd7a88082468.zip
Add math library definition for isfinite. From Brennan Ashton.
-rw-r--r--nuttx/include/nuttx/math.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/nuttx/include/nuttx/math.h b/nuttx/include/nuttx/math.h
index 35369ba53..11b289ed5 100644
--- a/nuttx/include/nuttx/math.h
+++ b/nuttx/include/nuttx/math.h
@@ -89,12 +89,13 @@
/* General Constants ********************************************************/
-#define INFINITY (1.0/0.0)
-#define NAN (0.0/0.0)
-#define HUGE_VAL INFINITY
+#define INFINITY (1.0/0.0)
+#define NAN (0.0/0.0)
+#define HUGE_VAL INFINITY
-#define isnan(x) ((x) != (x))
-#define isinf(x) (((x) == INFINITY) || ((x) == -INFINITY))
+#define isnan(x) ((x) != (x))
+#define isinf(x) (((x) == INFINITY) || ((x) == -INFINITY))
+#define isfinite(x) (!(isinf(x)) && (x != NAN))
/* Exponential and Logarithmic constants ************************************/