From 36d5c00ec64027f6d85ef10038e830802ab50f50 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 26 Jan 2015 13:55:49 -0600 Subject: [PATCH] Add math library definition for isfinite. From Brennan Ashton. --- include/nuttx/math.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/nuttx/math.h b/include/nuttx/math.h index 35369ba537f..11b289ed5cc 100644 --- a/include/nuttx/math.h +++ b/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 ************************************/