Changeset 2224 for trunk/psLib/src/math/psConstants.h
- Timestamp:
- Oct 27, 2004, 2:22:53 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psConstants.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psConstants.h
r2221 r2224 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-10-2 7 23:31:43 $8 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-10-28 00:22:53 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 #define PS_INT_CHECK_NON_NEGATIVE(NAME, RVAL) \ 33 33 if (NAME < 0) { \ 34 psError(__func__," %s is less than 0.", #NAME); \34 psError(__func__,"Error: %s is less than 0.", #NAME); \ 35 35 return(RVAL); \ 36 36 } … … 38 38 #define PS_INT_CHECK_POSITIVE(NAME, RVAL) \ 39 39 if (NAME < 1) { \ 40 psError(__func__,"%s is 0 or less.", #NAME); \ 41 return(RVAL); \ 42 } 43 40 psError(__func__,"Error: %s is 0 or less.", #NAME); \ 41 return(RVAL); \ 42 } 43 44 // Produce an error if ((NAME1 > NAME2) 44 45 #define PS_INT_COMPARE(NAME1, NAME2, RVAL) \ 45 if (NAME1 < NAME2) { \ 46 psError(__func__,"%s is less than %s (%d < %D).", #NAME1, #NAME2, NAME1, NAME2); \ 47 return(RVAL); \ 48 } 49 50 46 if (NAME1 > NAME2) { \ 47 psError(__func__,"Error: (%s > %s) (%d %d).", #NAME1, #NAME2, NAME1, NAME2); \ 48 return(RVAL); \ 49 } 50 51 52 // Produce an error if ((NAME1 > NAME2) 51 53 #define PS_FLOAT_COMPARE(NAME1, NAME2, RVAL) \ 52 if ((NAME1 - NAME2) < -FLT_EPSILON) { \ 53 psError(__func__,"%s is less than %s.", #NAME1, #NAME2); \ 54 return(RVAL); \ 55 } 56 57 54 if (NAME1 > NAME2) { \ 55 psError(__func__,"Error: (%s > %s) (%f %f)", #NAME1, #NAME2, NAME1, NAME2); \ 56 return(RVAL); \ 57 } 58 59 #define PS_FLOAT_CHECK_NON_EQUAL(NAME1, NAME2, RVAL) \ 60 if (fabs(NAME2 - NAME1) < FLT_EPSILON) { \ 61 psError(__func__,"Error: %s and %s are equal.", #NAME1, #NAME2); \ 62 return(RVAL); \ 63 } 58 64 59 65 /*****************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.
