The R Project SVN R

Rev

Rev 29455 | Rev 36820 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 29455 Rev 32538
Line 49... Line 49...
49
int R_IsNaN(double);		/* True for special NaN, *not* for NA */
49
int R_IsNaN(double);		/* True for special NaN, *not* for NA */
50
int R_finite(double);		/* True if none of NA, NaN, +/-Inf */
50
int R_finite(double);		/* True if none of NA, NaN, +/-Inf */
51
 
51
 
52
#define ISNA(x)	       R_IsNA(x)
52
#define ISNA(x)	       R_IsNA(x)
53
/* True for *both* NA and NaN.
53
/* True for *both* NA and NaN.
54
   NOTE: some systems do not return 1 for TRUE. */
54
   NOTE: some systems do not return 1 for TRUE. 
-
 
55
   Also note that C++ math headers specifically undefine
-
 
56
   isnan if it is a macro (it is on OS X and in C99),
-
 
57
   hence the workaround.  This code also appears in Rmath.h
-
 
58
*/
-
 
59
#ifdef __cplusplus
-
 
60
  int R_isnancpp(double); /* in arithmetic.c */
-
 
61
#  define ISNAN(x)     R_isnancpp(x)
-
 
62
#else
55
#define ISNAN(x)       (isnan(x)!=0)
63
#  define ISNAN(x)     (isnan(x)!=0)
-
 
64
#endif
-
 
65
 
56
#ifdef HAVE_WORKING_ISFINITE
66
#ifdef HAVE_WORKING_ISFINITE
57
/* isfinite is defined in <math.h> according to C99 */
67
/* isfinite is defined in <math.h> according to C99 */
58
# define R_FINITE(x)    isfinite(x)
68
# define R_FINITE(x)    isfinite(x)
59
#elif HAVE_WORKING_FINITE
69
#elif HAVE_WORKING_FINITE
60
/* include header needed to define finite() */
70
/* include header needed to define finite() */