/[escript]/trunk/esysUtils/src/maths.h
ViewVC logotype

Diff of /trunk/esysUtils/src/maths.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/paso/src/Common.h revision 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC branches/domexper/paso/src/Common.h revision 3079 by jfenwick, Tue Aug 3 04:04:51 2010 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*******************************************************
3  *  *
4  * Copyright (c) 2003-2009 by University of Queensland  * Copyright (c) 2003-2010 by University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * Earth Systems Science Computational Center (ESSCC)
6  * http://www.uq.edu.au/esscc  * http://www.uq.edu.au/esscc
7  *  *
# Line 64  typedef int err_t; Line 64  typedef int err_t;
64  #define EPSILON DBL_EPSILON  #define EPSILON DBL_EPSILON
65  #define LARGE_POSITIVE_FLOAT DBL_MAX  #define LARGE_POSITIVE_FLOAT DBL_MAX
66  #define SMALL_NEGATIVE_FLOAT -DBL_MAX  #define SMALL_NEGATIVE_FLOAT -DBL_MAX
67    /*#ifndef NAN
68       #define NAN (0.0/0.0)
69    #endif
70    */
71    /*#define IS_NAN(__VAL__)  ( (__VAL__) == NAN )*/  /* this does not work */
72    /* #define IS_NAN(__VAL__)  ( ! ( ( (__VAL__) >= 0. ) ||  ( (__VAL__) <= 0. ) ) )  this does not work */
73    
74    #ifdef isnan
75      #define IS_NAN(__VAL__) (isnan(__VAL__))
76    #elif defined _isnan
77      #define IS_NAN(__VAL__) (_isnan(__VAL__))
78    #else
79    /* If we do not have isnan then we can't reliably check for NaN - return false */
80      #define IS_NAN(__VAL__) (0)
81    #endif
82    
83  /**************************************************************/  /**************************************************************/
84    
# Line 92  typedef int err_t; Line 107  typedef int err_t;
107                                  _a0_= (_a1_); \                                  _a0_= (_a1_); \
108                                  _a1_=s; \                                  _a1_=s; \
109                                 }                                 }
110    #define XNOR(_a0_,_a1_) ( ( (_a0_) && (_a1_) ) || ( !(_a0_) && !(_a1_) ) )
111  /**************************************************************/  /**************************************************************/
112  /*    memory allocation:                                      */  /*    memory allocation:                                      */
113  /*    Wise to not use PASO_MALLOC/FREE/REALLOC and            */  /*    Wise to not use PASO_MALLOC/FREE/REALLOC and            */

Legend:
Removed from v.2548  
changed lines
  Added in v.3079

  ViewVC Help
Powered by ViewVC 1.1.26