1 | #define BUFFERLENGTH 200000 |
---|
2 | |
---|
3 | #ifndef TRUE |
---|
4 | #define TRUE 1 |
---|
5 | #endif |
---|
6 | |
---|
7 | #ifndef FALSE |
---|
8 | #define FALSE 0 |
---|
9 | #endif |
---|
10 | |
---|
11 | #define INTEGER_MAX 2147483648 |
---|
12 | #define REAL_MAX 1.7976931348623157E+308 |
---|
13 | #define REAL_MIN 2.2250738585072014E-308 |
---|
14 | #define LOG_REAL_MIN -708.396 |
---|
15 | |
---|
16 | #define INTEGER_MAX2EXP 31 |
---|
17 | #define REAL_MAX2EXP 1024 |
---|
18 | #define REAL_MIN2EXP -1022 |
---|
19 | |
---|
20 | #define LOG2 0.6931471805599453094172321214581765680755 |
---|
21 | #define PI 3.141592653589793238462643383279502884197 |
---|
22 | |
---|
23 | #define Make(x,ref) ((x)->t=ELEMENT,(x)->r=ref) |
---|
24 | #define MakeList(x) ((x)->t=ELEMENT,(x)->r=List_R) |
---|
25 | #define MakeInteger(x,val) ((x)->t=INTEGER,(x)->u.v.i=val) |
---|
26 | |
---|
27 | #define Is(x,ref) ((x)->t==ELEMENT&&(x)->r==ref) |
---|
28 | #define IsList(x) ((x)->t==ELEMENT&&(x)->r==List_R) |
---|
29 | #define IsInteger(x) ((x)->t==INTEGER) |
---|
30 | #define IsReal(x) ((x)->t==REAL) |
---|
31 | #define IsNumber(x) ((x)->t==INTEGER||(x)->t==REAL) |
---|
32 | |
---|
33 | #define Is0(x) ((x)->t==INTEGER&&(x)->u.v.i==0||(x)->t==REAL&&(x)->u.v.r==0.) |
---|
34 | #define Is1(x) ((x)->t==INTEGER&&(x)->u.v.i==1||(x)->t==REAL&&(x)->u.v.r==1.) |
---|
35 | #define IsMinus1(x) ((x)->t==INTEGER&&(x)->u.v.i==-1||(x)->t==REAL&&(x)->u.v.r==-1.) |
---|
36 | #define IsPositiveNumber(x) ((x)->t==INTEGER&&(x)->u.v.i>0||(x)->t==REAL&&(x)->u.v.r>0.) |
---|
37 | #define IsNegativeNumber(x) ((x)->t==INTEGER&&(x)->u.v.i<0||(x)->t==REAL&&(x)->u.v.r<0.) |
---|
38 | #define IsPositiveInteger(x) ((x)->t==INTEGER&&(x)->u.v.i>0) |
---|
39 | #define IsNegativeInteger(x) ((x)->t==INTEGER&&(x)->u.v.i<0) |
---|
40 | |
---|
41 | #define Has1Arg(x) ((x)->l&&!(x)->l->n) |
---|
42 | #define Has2Args(x) ((x)->l&&(x)->l->n&&!(x)->l->n->n) |
---|
43 | |
---|
44 | |
---|