Rev 7798 | Rev 8079 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7798 | Rev 7847 | ||
---|---|---|---|
Line 149... | Line 149... | ||
149 | double min(double d1, double d2); |
149 | double min(double d1, double d2); |
150 | double gcd(double n1, double n2); |
150 | double gcd(double n1, double n2); |
151 | double lcm(double n1, double n2); |
151 | double lcm(double n1, double n2); |
152 | int eval_getpos(char *name); /* get position of name in nametable */ |
152 | int eval_getpos(char *name); /* get position of name in nametable */ |
153 | void eval_setval(int pos, double v); /* set value to name */ |
153 | void eval_setval(int pos, double v); /* set value to name */ |
154 |
|
154 | /*void set_evalue_pointer(char *p); */ /* prepare pointer for evaluation */ |
155 |
|
155 | /* char *get_evalue_pointer(void); */ /* get string pointer (after evaluation) */ |
156 |
|
156 | /* double _evalue(int ord);*/ |
157 | double strevalue(char *p); /* evalue a string to double */ |
157 | double strevalue(char *p); /* evalue a string to double after checking it*/ |
- | 158 | double checked_eval (char* p); /* evalue a string to double */ |
|
158 | char *(*substitute) (char *p); |
159 | char *(*substitute) (char *p); |
159 |
|
160 | /* int get_evalue_error(void); |
160 |
|
161 | void set_evalue_error(int e);*/ |
161 | int get_evalcnt(void); |
162 | int get_evalcnt(void); |
162 | char *get_evalname(int i); |
163 | char *get_evalname(int i); |
163 | int get_evaltype(int i); |
164 | int get_evaltype(int i); |
164 | int evaltab_verify(void); |
165 | int evaltab_verify(void); |
165 | int search_evaltab(char *p); |
166 | int search_evaltab(char *p); |
166 | /* compile an expression for faster evaluation |
167 | /* compile an expression for faster evaluation |
167 | * returns -1 if cannot be compiled. |
168 | * returns -1 if cannot be compiled. |
168 | * else returns the number of compilations. |
169 | * else returns the number of compilations. |
169 | */ |
170 | */ |
170 | int evalue_compile(char *p); |
171 | int evalue_compile(char *p); |
- | 172 | typedef struct eval_struct {char *texte; int x; int y; int s; int t;} eval_struct; |
|
- | 173 | eval_struct * eval_create (char *in_p); /* speed up the evaluation by |
|
- | 174 | "precompiling" the string to be evaluated.*/ |
|
- | 175 | /* evaluate standard functions with at most four variables named |
|
- | 176 | * "x", "y", "s" and "t" |
|
- | 177 | */ |
|
- | 178 | ||
- | 179 | double eval_x (eval_struct *p, double x); /* evaluate standard function in x*/ |
|
- | 180 | double eval_t (eval_struct *p, double t); /* evaluate standard function in t*/ |
|
- | 181 | double eval_x_y (eval_struct *p, double x, double y); /* evaluate standard function in x and y*/ |
|
- | 182 | double eval_multiple (eval_struct *p, double x, double y, double s, double t); |
|
- | 183 | void eval_destroy (eval_struct *q); /* reclaim the memory */ |
|
171 | 184 | ||
172 | /* math.c */ |
185 | /* math.c */ |
173 | char *find_mathvar_start(char *p); /* Points to the start of a mathematics variable (or number) */ |
186 | char *find_mathvar_start(char *p); /* Points to the start of a mathematics variable (or number) */ |
174 | char *find_mathvar_end(char *p); /* Points to the end of a mathematics variable (or number) */ |
187 | char *find_mathvar_end(char *p); /* Points to the end of a mathematics variable (or number) */ |
175 | void mathvarlist(char *p); /* list variable (function) names in an expression. buffer is modified to contain the list. */ |
188 | void mathvarlist(char *p); /* list variable (function) names in an expression. buffer is modified to contain the list. */ |