1 |
– |
/* Copyright (c) 1991 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* calfunc.c - routines for calcomp using functions. |
6 |
|
* |
7 |
< |
* The define BIGLIB pulls in a large number of the |
11 |
< |
* available math routines. |
12 |
< |
* |
13 |
< |
* If VARIABLE is not defined, only library functions |
7 |
> |
* If VARIABLE is not set, only library functions |
8 |
|
* can be accessed. |
9 |
|
* |
10 |
< |
* 4/2/86 |
10 |
> |
* 2/19/03 Eliminated conditional compiles in favor of esupport extern. |
11 |
|
*/ |
12 |
|
|
13 |
< |
#include <stdio.h> |
13 |
> |
#include "copyright.h" |
14 |
|
|
15 |
+ |
#include <stdio.h> |
16 |
+ |
#include <string.h> |
17 |
|
#include <errno.h> |
18 |
+ |
#include <math.h> |
19 |
|
|
20 |
+ |
#include "rterror.h" |
21 |
|
#include "calcomp.h" |
22 |
|
|
23 |
|
/* bits in argument flag (better be right!) */ |
24 |
|
#define AFLAGSIZ (8*sizeof(unsigned long)) |
25 |
< |
#define ALISTSIZ 6 /* maximum saved argument list */ |
25 |
> |
#define ALISTSIZ 8 /* maximum saved argument list */ |
26 |
|
|
27 |
|
typedef struct activation { |
28 |
|
char *name; /* function name */ |
34 |
|
|
35 |
|
static ACTIVATION *curact = NULL; |
36 |
|
|
37 |
< |
static double libfunc(); |
37 |
> |
static double libfunc(char *fname, VARDEF *vp); |
38 |
|
|
39 |
+ |
#ifndef MAXLIB |
40 |
|
#define MAXLIB 64 /* maximum number of library functions */ |
42 |
– |
|
43 |
– |
static double l_if(), l_select(), l_rand(); |
44 |
– |
static double l_floor(), l_ceil(); |
45 |
– |
#ifdef BIGLIB |
46 |
– |
static double l_sqrt(); |
47 |
– |
static double l_sin(), l_cos(), l_tan(); |
48 |
– |
static double l_asin(), l_acos(), l_atan(), l_atan2(); |
49 |
– |
static double l_exp(), l_log(), l_log10(); |
41 |
|
#endif |
42 |
|
|
43 |
< |
#ifdef BIGLIB |
43 |
> |
static double l_if(char *), l_select(char *); |
44 |
> |
static double l_min(char *), l_max(char *); |
45 |
> |
static double l_rand(char *); |
46 |
> |
static double l_floor(char *), l_ceil(char *); |
47 |
> |
static double l_sqrt(char *); |
48 |
> |
static double l_sin(char *), l_cos(char *), l_tan(char *); |
49 |
> |
static double l_asin(char *), l_acos(char *), l_atan(char *), l_atan2(char *); |
50 |
> |
static double l_exp(char *), l_log(char *), l_log10(char *); |
51 |
> |
|
52 |
|
/* functions must be listed alphabetically */ |
53 |
|
static LIBR library[MAXLIB] = { |
54 |
|
{ "acos", 1, ':', l_acos }, |
62 |
|
{ "if", 3, ':', l_if }, |
63 |
|
{ "log", 1, ':', l_log }, |
64 |
|
{ "log10", 1, ':', l_log10 }, |
65 |
+ |
{ "max", 1, ':', l_max }, |
66 |
+ |
{ "min", 1, ':', l_min }, |
67 |
|
{ "rand", 1, ':', l_rand }, |
68 |
|
{ "select", 1, ':', l_select }, |
69 |
|
{ "sin", 1, ':', l_sin }, |
73 |
|
|
74 |
|
static int libsize = 16; |
75 |
|
|
75 |
– |
#else |
76 |
– |
/* functions must be listed alphabetically */ |
77 |
– |
static LIBR library[MAXLIB] = { |
78 |
– |
{ "ceil", 1, ':', l_ceil }, |
79 |
– |
{ "floor", 1, ':', l_floor }, |
80 |
– |
{ "if", 3, ':', l_if }, |
81 |
– |
{ "rand", 1, ':', l_rand }, |
82 |
– |
{ "select", 1, ':', l_select }, |
83 |
– |
}; |
84 |
– |
|
85 |
– |
static int libsize = 5; |
86 |
– |
|
87 |
– |
#endif |
88 |
– |
|
89 |
– |
extern char *savestr(), *emalloc(); |
90 |
– |
|
91 |
– |
extern VARDEF *argf(); |
92 |
– |
|
93 |
– |
#ifdef VARIABLE |
76 |
|
#define resolve(ep) ((ep)->type==VAR?(ep)->v.ln:argf((ep)->v.chan)) |
95 |
– |
#else |
96 |
– |
#define resolve(ep) ((ep)->v.ln) |
97 |
– |
#define varlookup(name) NULL |
98 |
– |
#endif |
77 |
|
|
78 |
|
|
79 |
|
int |
80 |
< |
fundefined(fname) /* return # of arguments for function */ |
81 |
< |
char *fname; |
80 |
> |
fundefined( /* return # of req'd arguments for function */ |
81 |
> |
char *fname |
82 |
> |
) |
83 |
|
{ |
84 |
|
LIBR *lp; |
85 |
< |
register VARDEF *vp; |
85 |
> |
VARDEF *vp; |
86 |
|
|
87 |
< |
if ((vp = varlookup(fname)) == NULL || vp->def == NULL |
88 |
< |
|| vp->def->v.kid->type != FUNC) |
110 |
< |
if ((lp = liblookup(fname)) == NULL) |
111 |
< |
return(0); |
112 |
< |
else |
113 |
< |
return(lp->nargs); |
114 |
< |
else |
87 |
> |
if ((vp = varlookup(fname)) != NULL && vp->def != NULL |
88 |
> |
&& vp->def->v.kid->type == FUNC) |
89 |
|
return(nekids(vp->def->v.kid) - 1); |
90 |
+ |
lp = vp != NULL ? vp->lib : liblookup(fname); |
91 |
+ |
if (lp == NULL) |
92 |
+ |
return(0); |
93 |
+ |
return(lp->nargs); |
94 |
|
} |
95 |
|
|
96 |
|
|
97 |
|
double |
98 |
< |
funvalue(fname, n, a) /* return a function value to the user */ |
99 |
< |
char *fname; |
100 |
< |
int n; |
101 |
< |
double *a; |
98 |
> |
funvalue( /* return a function value to the user */ |
99 |
> |
char *fname, |
100 |
> |
int n, |
101 |
> |
double *a |
102 |
> |
) |
103 |
|
{ |
104 |
|
ACTIVATION act; |
105 |
< |
register VARDEF *vp; |
105 |
> |
VARDEF *vp; |
106 |
|
double rval; |
107 |
|
/* push environment */ |
108 |
|
act.name = fname; |
109 |
|
act.prev = curact; |
110 |
|
act.ap = a; |
111 |
< |
if (n >= AFLAGSIZ) |
133 |
< |
act.an = ~0; |
134 |
< |
else |
111 |
> |
if (n < AFLAGSIZ) |
112 |
|
act.an = (1L<<n)-1; |
113 |
+ |
else { |
114 |
+ |
act.an = ~0; |
115 |
+ |
if (n > AFLAGSIZ) |
116 |
+ |
wputs("Excess arguments in funvalue()\n"); |
117 |
+ |
} |
118 |
|
act.fun = NULL; |
119 |
|
curact = &act; |
120 |
|
|
129 |
|
} |
130 |
|
|
131 |
|
|
132 |
< |
funset(fname, nargs, assign, fptr) /* set a library function */ |
133 |
< |
char *fname; |
134 |
< |
int nargs; |
135 |
< |
int assign; |
136 |
< |
double (*fptr)(); |
132 |
> |
void |
133 |
> |
funset( /* set a library function */ |
134 |
> |
char *fname, |
135 |
> |
int nargs, |
136 |
> |
int assign, |
137 |
> |
double (*fptr)(char *) |
138 |
> |
) |
139 |
|
{ |
140 |
< |
register LIBR *lp; |
141 |
< |
|
140 |
> |
int oldlibsize = libsize; |
141 |
> |
char *cp; |
142 |
> |
LIBR *lp; |
143 |
> |
/* check for context */ |
144 |
> |
for (cp = fname; *cp; cp++) |
145 |
> |
; |
146 |
> |
if (cp == fname) |
147 |
> |
return; |
148 |
> |
while (cp[-1] == CNTXMARK) { |
149 |
> |
*--cp = '\0'; |
150 |
> |
if (cp == fname) return; |
151 |
> |
} |
152 |
|
if ((lp = liblookup(fname)) == NULL) { /* insert */ |
153 |
|
if (libsize >= MAXLIB) { |
154 |
|
eputs("Too many library functons!\n"); |
155 |
|
quit(1); |
156 |
|
} |
157 |
|
for (lp = &library[libsize]; lp > library; lp--) |
158 |
< |
if (strcmp(lp[-1].fname, fname) > 0) { |
159 |
< |
lp[0].fname = lp[-1].fname; |
160 |
< |
lp[0].nargs = lp[-1].nargs; |
167 |
< |
lp[0].atyp = lp[-1].atyp; |
168 |
< |
lp[0].f = lp[-1].f; |
169 |
< |
} else |
158 |
> |
if (strcmp(lp[-1].fname, fname) > 0) |
159 |
> |
lp[0] = lp[-1]; |
160 |
> |
else |
161 |
|
break; |
162 |
|
libsize++; |
163 |
|
} |
164 |
|
if (fptr == NULL) { /* delete */ |
165 |
|
while (lp < &library[libsize-1]) { |
166 |
< |
lp[0].fname = lp[1].fname; |
176 |
< |
lp[0].nargs = lp[1].nargs; |
177 |
< |
lp[0].atyp = lp[1].atyp; |
178 |
< |
lp[0].f = lp[1].f; |
166 |
> |
lp[0] = lp[1]; |
167 |
|
lp++; |
168 |
|
} |
169 |
|
libsize--; |
173 |
|
lp[0].atyp = assign; |
174 |
|
lp[0].f = fptr; |
175 |
|
} |
176 |
< |
libupdate(fname); /* relink library */ |
176 |
> |
if (libsize != oldlibsize) |
177 |
> |
libupdate(fname); /* relink library */ |
178 |
|
} |
179 |
|
|
180 |
|
|
181 |
|
int |
182 |
< |
nargum() /* return number of available arguments */ |
182 |
> |
nargum(void) /* return number of available arguments */ |
183 |
|
{ |
184 |
< |
register int n; |
184 |
> |
int n; |
185 |
|
|
186 |
|
if (curact == NULL) |
187 |
|
return(0); |
195 |
|
|
196 |
|
|
197 |
|
double |
198 |
< |
argument(n) /* return nth argument for active function */ |
210 |
< |
register int n; |
198 |
> |
argument(int n) /* return nth argument for active function */ |
199 |
|
{ |
200 |
< |
register ACTIVATION *actp = curact; |
201 |
< |
register EPNODE *ep; |
200 |
> |
ACTIVATION *actp = curact; |
201 |
> |
EPNODE *ep = NULL; |
202 |
|
double aval; |
203 |
|
|
204 |
< |
if (actp == NULL || --n < 0) { |
204 |
> |
if (!n) /* asking for # arguments? */ |
205 |
> |
return((double)nargum()); |
206 |
> |
|
207 |
> |
if (!actp | (--n < 0)) { |
208 |
|
eputs("Bad call to argument!\n"); |
209 |
|
quit(1); |
210 |
|
} |
211 |
< |
/* already computed? */ |
221 |
< |
if (n < AFLAGSIZ && 1L<<n & actp->an) |
211 |
> |
if ((n < AFLAGSIZ) & actp->an >> n) /* already computed? */ |
212 |
|
return(actp->ap[n]); |
213 |
|
|
214 |
< |
if (actp->fun == NULL || (ep = ekid(actp->fun, n+1)) == NULL) { |
214 |
> |
if (!actp->fun || !(ep = ekid(actp->fun, n+1))) { |
215 |
|
eputs(actp->name); |
216 |
|
eputs(": too few arguments\n"); |
217 |
|
quit(1); |
218 |
|
} |
219 |
< |
curact = actp->prev; /* pop environment */ |
219 |
> |
curact = actp->prev; /* previous context */ |
220 |
|
aval = evalue(ep); /* compute argument */ |
221 |
< |
curact = actp; /* push back environment */ |
222 |
< |
if (n < ALISTSIZ) { /* save value */ |
221 |
> |
curact = actp; /* put back calling context */ |
222 |
> |
if (n < ALISTSIZ) { /* save value if room */ |
223 |
|
actp->ap[n] = aval; |
224 |
|
actp->an |= 1L<<n; |
225 |
|
} |
227 |
|
} |
228 |
|
|
229 |
|
|
240 |
– |
#ifdef VARIABLE |
230 |
|
VARDEF * |
231 |
< |
argf(n) /* return function def for nth argument */ |
243 |
< |
int n; |
231 |
> |
argf(int n) /* return function def for nth argument */ |
232 |
|
{ |
233 |
< |
register ACTIVATION *actp; |
234 |
< |
register EPNODE *ep; |
233 |
> |
ACTIVATION *actp; |
234 |
> |
EPNODE *ep; |
235 |
|
|
236 |
|
for (actp = curact; actp != NULL; actp = actp->prev) { |
237 |
|
|
261 |
|
eputs(actp->name); |
262 |
|
eputs(": argument not a function\n"); |
263 |
|
quit(1); |
264 |
+ |
return NULL; /* pro forma return */ |
265 |
|
} |
266 |
|
|
267 |
|
|
268 |
|
char * |
269 |
< |
argfun(n) /* return function name for nth argument */ |
281 |
< |
int n; |
269 |
> |
argfun(int n) /* return function name for nth argument */ |
270 |
|
{ |
271 |
|
return(argf(n)->name); |
272 |
|
} |
285 |
– |
#endif |
273 |
|
|
274 |
|
|
275 |
|
double |
276 |
< |
efunc(ep) /* evaluate a function */ |
290 |
< |
register EPNODE *ep; |
276 |
> |
efunc(EPNODE *ep) /* evaluate a function */ |
277 |
|
{ |
278 |
|
ACTIVATION act; |
279 |
|
double alist[ALISTSIZ]; |
280 |
|
double rval; |
281 |
< |
register VARDEF *dp; |
281 |
> |
VARDEF *dp; |
282 |
|
/* push environment */ |
283 |
|
dp = resolve(ep->v.kid); |
284 |
|
act.name = dp->name; |
299 |
|
|
300 |
|
|
301 |
|
LIBR * |
302 |
< |
liblookup(fname) /* look up a library function */ |
317 |
< |
char *fname; |
302 |
> |
liblookup(char *fname) /* look up a library function */ |
303 |
|
{ |
304 |
|
int upper, lower; |
305 |
< |
register int cm, i; |
305 |
> |
int cm, i; |
306 |
|
|
307 |
|
lower = 0; |
308 |
|
upper = cm = libsize; |
321 |
|
} |
322 |
|
|
323 |
|
|
339 |
– |
#ifndef VARIABLE |
340 |
– |
static VARDEF *varlist = NULL; /* our list of dummy variables */ |
341 |
– |
|
342 |
– |
|
343 |
– |
VARDEF * |
344 |
– |
varinsert(vname) /* dummy variable insert */ |
345 |
– |
char *vname; |
346 |
– |
{ |
347 |
– |
register VARDEF *vp; |
348 |
– |
|
349 |
– |
vp = (VARDEF *)emalloc(sizeof(VARDEF)); |
350 |
– |
vp->name = savestr(vname); |
351 |
– |
vp->nlinks = 1; |
352 |
– |
vp->def = NULL; |
353 |
– |
vp->lib = liblookup(vname); |
354 |
– |
vp->next = varlist; |
355 |
– |
varlist = vp; |
356 |
– |
return(vp); |
357 |
– |
} |
358 |
– |
|
359 |
– |
|
360 |
– |
varfree(vp) /* free dummy variable */ |
361 |
– |
register VARDEF *vp; |
362 |
– |
{ |
363 |
– |
register VARDEF *vp2; |
364 |
– |
|
365 |
– |
if (vp == varlist) |
366 |
– |
varlist = vp->next; |
367 |
– |
else { |
368 |
– |
for (vp2 = varlist; vp2->next != vp; vp2 = vp2->next) |
369 |
– |
; |
370 |
– |
vp2->next = vp->next; |
371 |
– |
} |
372 |
– |
freestr(vp->name); |
373 |
– |
efree((char *)vp); |
374 |
– |
} |
375 |
– |
|
376 |
– |
|
377 |
– |
libupdate(nm) /* update library */ |
378 |
– |
char *nm; |
379 |
– |
{ |
380 |
– |
register VARDEF *vp; |
381 |
– |
|
382 |
– |
for (vp = varlist; vp != NULL; vp = vp->next) |
383 |
– |
vp->lib = liblookup(vp->name); |
384 |
– |
} |
385 |
– |
#endif |
386 |
– |
|
387 |
– |
|
388 |
– |
|
324 |
|
/* |
325 |
|
* The following routines are for internal use: |
326 |
|
*/ |
327 |
|
|
328 |
|
|
329 |
|
static double |
330 |
< |
libfunc(fname, vp) /* execute library function */ |
331 |
< |
char *fname; |
332 |
< |
VARDEF *vp; |
330 |
> |
libfunc( /* execute library function */ |
331 |
> |
char *fname, |
332 |
> |
VARDEF *vp |
333 |
> |
) |
334 |
|
{ |
335 |
< |
register LIBR *lp; |
335 |
> |
LIBR *lp; |
336 |
|
double d; |
337 |
|
int lasterrno; |
338 |
|
|
348 |
|
lasterrno = errno; |
349 |
|
errno = 0; |
350 |
|
d = (*lp->f)(lp->fname); |
351 |
< |
#ifdef IEEE |
352 |
< |
if (errno == 0) |
351 |
> |
#ifdef isnan |
352 |
> |
if (errno == 0) { |
353 |
|
if (isnan(d)) |
354 |
|
errno = EDOM; |
355 |
|
else if (isinf(d)) |
356 |
|
errno = ERANGE; |
357 |
+ |
} |
358 |
|
#endif |
359 |
< |
if (errno) { |
359 |
> |
if (errno == EDOM || errno == ERANGE) { |
360 |
|
wputs(fname); |
361 |
|
if (errno == EDOM) |
362 |
|
wputs(": domain error\n"); |
377 |
|
|
378 |
|
|
379 |
|
static double |
380 |
< |
l_if() /* if(cond, then, else) conditional expression */ |
380 |
> |
l_if(char *nm) /* if(cond, then, else) conditional expression */ |
381 |
|
/* cond evaluates true if greater than zero */ |
382 |
|
{ |
383 |
|
if (argument(1) > 0.0) |
388 |
|
|
389 |
|
|
390 |
|
static double |
391 |
< |
l_select() /* return argument #(A1+1) */ |
391 |
> |
l_select(char *nm) /* return argument #(A1+1) */ |
392 |
|
{ |
393 |
< |
register int n; |
393 |
> |
int n; |
394 |
|
|
395 |
< |
n = argument(1) + .5; |
395 |
> |
n = (int)(argument(1) + .5); |
396 |
|
if (n == 0) |
397 |
|
return(nargum()-1); |
398 |
|
if (n < 1 || n > nargum()-1) { |
404 |
|
|
405 |
|
|
406 |
|
static double |
407 |
< |
l_rand() /* random function between 0 and 1 */ |
407 |
> |
l_max(char *nm) /* general maximum function */ |
408 |
|
{ |
409 |
< |
extern double floor(); |
409 |
> |
int n = nargum(); |
410 |
> |
int i = 1; |
411 |
> |
int vmax = argument(1); |
412 |
> |
|
413 |
> |
while (i++ < n) { |
414 |
> |
double v = argument(i); |
415 |
> |
if (vmax < v) |
416 |
> |
vmax = v; |
417 |
> |
} |
418 |
> |
return(vmax); |
419 |
> |
} |
420 |
> |
|
421 |
> |
|
422 |
> |
static double |
423 |
> |
l_min(char *nm) /* general minimum function */ |
424 |
> |
{ |
425 |
> |
int n = nargum(); |
426 |
> |
int i = 1; |
427 |
> |
int vmin = argument(1); |
428 |
> |
|
429 |
> |
while (i++ < n) { |
430 |
> |
double v = argument(i); |
431 |
> |
if (vmin > v) |
432 |
> |
vmin = v; |
433 |
> |
} |
434 |
> |
return(vmin); |
435 |
> |
} |
436 |
> |
|
437 |
> |
|
438 |
> |
static double |
439 |
> |
l_rand(char *nm) /* random function between 0 and 1 */ |
440 |
> |
{ |
441 |
|
double x; |
442 |
|
|
443 |
|
x = argument(1); |
449 |
|
|
450 |
|
|
451 |
|
static double |
452 |
< |
l_floor() /* return largest integer not greater than arg1 */ |
452 |
> |
l_floor(char *nm) /* return largest integer not greater than arg1 */ |
453 |
|
{ |
486 |
– |
extern double floor(); |
487 |
– |
|
454 |
|
return(floor(argument(1))); |
455 |
|
} |
456 |
|
|
457 |
|
|
458 |
|
static double |
459 |
< |
l_ceil() /* return smallest integer not less than arg1 */ |
459 |
> |
l_ceil(char *nm) /* return smallest integer not less than arg1 */ |
460 |
|
{ |
495 |
– |
extern double ceil(); |
496 |
– |
|
461 |
|
return(ceil(argument(1))); |
462 |
|
} |
463 |
|
|
464 |
|
|
501 |
– |
#ifdef BIGLIB |
465 |
|
static double |
466 |
< |
l_sqrt() |
466 |
> |
l_sqrt(char *nm) |
467 |
|
{ |
505 |
– |
extern double sqrt(); |
506 |
– |
|
468 |
|
return(sqrt(argument(1))); |
469 |
|
} |
470 |
|
|
471 |
|
|
472 |
|
static double |
473 |
< |
l_sin() |
473 |
> |
l_sin(char *nm) |
474 |
|
{ |
514 |
– |
extern double sin(); |
515 |
– |
|
475 |
|
return(sin(argument(1))); |
476 |
|
} |
477 |
|
|
478 |
|
|
479 |
|
static double |
480 |
< |
l_cos() |
480 |
> |
l_cos(char *nm) |
481 |
|
{ |
523 |
– |
extern double cos(); |
524 |
– |
|
482 |
|
return(cos(argument(1))); |
483 |
|
} |
484 |
|
|
485 |
|
|
486 |
|
static double |
487 |
< |
l_tan() |
487 |
> |
l_tan(char *nm) |
488 |
|
{ |
532 |
– |
extern double tan(); |
533 |
– |
|
489 |
|
return(tan(argument(1))); |
490 |
|
} |
491 |
|
|
492 |
|
|
493 |
|
static double |
494 |
< |
l_asin() |
494 |
> |
l_asin(char *nm) |
495 |
|
{ |
541 |
– |
extern double asin(); |
542 |
– |
|
496 |
|
return(asin(argument(1))); |
497 |
|
} |
498 |
|
|
499 |
|
|
500 |
|
static double |
501 |
< |
l_acos() |
501 |
> |
l_acos(char *nm) |
502 |
|
{ |
550 |
– |
extern double acos(); |
551 |
– |
|
503 |
|
return(acos(argument(1))); |
504 |
|
} |
505 |
|
|
506 |
|
|
507 |
|
static double |
508 |
< |
l_atan() |
508 |
> |
l_atan(char *nm) |
509 |
|
{ |
559 |
– |
extern double atan(); |
560 |
– |
|
510 |
|
return(atan(argument(1))); |
511 |
|
} |
512 |
|
|
513 |
|
|
514 |
|
static double |
515 |
< |
l_atan2() |
515 |
> |
l_atan2(char *nm) |
516 |
|
{ |
568 |
– |
extern double atan2(); |
569 |
– |
|
517 |
|
return(atan2(argument(1), argument(2))); |
518 |
|
} |
519 |
|
|
520 |
|
|
521 |
|
static double |
522 |
< |
l_exp() |
522 |
> |
l_exp(char *nm) |
523 |
|
{ |
577 |
– |
extern double exp(); |
578 |
– |
|
524 |
|
return(exp(argument(1))); |
525 |
|
} |
526 |
|
|
527 |
|
|
528 |
|
static double |
529 |
< |
l_log() |
529 |
> |
l_log(char *nm) |
530 |
|
{ |
586 |
– |
extern double log(); |
587 |
– |
|
531 |
|
return(log(argument(1))); |
532 |
|
} |
533 |
|
|
534 |
|
|
535 |
|
static double |
536 |
< |
l_log10() |
536 |
> |
l_log10(char *nm) |
537 |
|
{ |
595 |
– |
extern double log10(); |
596 |
– |
|
538 |
|
return(log10(argument(1))); |
539 |
|
} |
599 |
– |
#endif |