/* various functions from the c math library */
double sin(),cos(),asin(),acos(),atan2(),sqrt(), log(), exp();
switch(TYPE(handy
=lbot
->val
)) {
case INT
: res
= func((double)handy
->i
);
case DOUB
: res
= func(handy
->r
);
default: error("Non fixnum or flonum to math function",FALSE
);
/* although we call this atan, it is really atan2 to the c-world,
that is, it takes two args
switch(TYPE(arg
=lbot
->val
)) {
case INT
: arg1v
= (double) arg
->i
;
case DOUB
: arg1v
= arg
->r
;
default: error("Non fixnum or flonum arg to atan2",FALSE
);
switch(TYPE(arg
= (lbot
+1)->val
)) {
case INT
: res
= atan2(arg1v
,(double) arg
->i
);
case DOUB
: res
= atan2(arg1v
, arg
->r
);
default: error("Non fixnum or flonum to atan2",FALSE
);
/* (random) returns a fixnum in the range -2**30 to 2**30 -1
(random fixnum) returns a fixnum in the range 0 to fixnum-1
curval
= rand(); /* get numb from 0 to 2**31-1 */
if(np
==lbot
) return(inewint(curval
-(int)pow((double)2,(double)30)));
if((TYPE(lbot
->val
) != INT
)
|| (lbot
->val
->i
<= 0)) errorh(Vermisc
,"random: non fixnum arg:",
nil
, FALSE
, 0, lbot
->val
);
return(inewint(curval
% lbot
->val
->i
));
if(work
==nil
|| (TYPE(work
)!=ATOM
))
register double *handy
, *base
;
register struct argent
*argp
, *lbot
, *np
;
lispval result
; int type
;
count
= 2 * (((int) np
) - (int) lbot
);
base
= handy
= (double *) alloca(count
);
for(argp
= lbot
; argp
< np
; argp
++) {
while((type
= TYPE(argp
->val
))!=DOUB
&& type
!=INT
)
argp
->val
= (lispval
) errorh(Vermisc
,"%%machine-polyev:non-real arg",nil
,TRUE
,73,lbot
,argp
->val
);
if(TYPE(argp
->val
)==INT
) {
count
= count
/sizeof(double) - 2;
asm("polyd (r9),r11,8(r9)");