home *** CD-ROM | disk | FTP | other *** search
- /* ffp.h */
-
- #define FFP_H 1
- #include <float.h>
- #include <math.h>
-
- typedef double FFP;
- extern double atof(char *);
- #define atoFFP(x) (FFP)atof(x)
-
- #ifdef MAIN_MODULE
- FFP FFPLARGE = 1.0e10, FFPSMALL = 1.0e-10;
- #else
- extern FFP FFPLARGE, FFPSMALL;
- #endif
-
- #ifndef max
- #define max(a,b) (((a)>(b)) ? (a) : (b))
- #define min(a,b) (((a)>(b)) ? (b) : (a))
- #endif
-
- #define NINT(a) ((int)((a)>=0 ? (a)+0.5 : (a)-0.5))
-
- /* a AND b DIFFER BY LESS THAN DEFAULT TOLERANCE ? */
- #define FFPSAME(a,b) (abs((a)-(b)) <= FFPSMALL)
-
- /* a AND b DIFFER BY LESS THAN c */
- #define FFPNEAR(a,b,c) (abs((a)-(b)) <= (c))
-
-