franz/lam8.c
/* although we call this atan, it is really atan2 to the c-world,
   that is, it takes two args
 */
although we call this atan, it is really atan2 to the c-world,
that is, it takes two args
although we call this atan it is really atan2 to the c - world that is it takes two args
lispval Latan()
{
	register lispval arg;
	register double arg1v;
	register double res;
	chkarg(2,"arctan");
	switch(TYPE(arg=lbot->val)) {
	case INT:  arg1v = (double) arg->i;
		   break;
	case DOUB: arg1v = arg->r;
		   break;
	default:   error("Non fixnum or flonum arg to atan2",FALSE);
	}
	switch(TYPE(arg = (lbot+1)->val)) {
	case INT: res = atan2(arg1v,(double) arg->i);
		  break;
	case DOUB: res = atan2(arg1v, arg->r);
		  break;
	default:  error("Non fixnum or flonum to atan2",FALSE);
	}
	arg = newdoub();
	arg->r = res;
	return(arg);
}
lispval Latan ( ) { register lispval arg ; register double arg1v ; register double res ; chkarg ( 2 , " " ) ; switch ( TYPE ( arg = lbot -> val ) ) { case INT : arg1v = ( double ) arg -> i ; break ; case DOUB : arg1v = arg -> r ; break ; default : error ( " " , FALSE ) ; } switch ( TYPE ( arg = ( lbot + 1 ) -> val ) ) { case INT : res = atan2 ( arg1v , ( double ) arg -> i ) ; break ; case DOUB : res = atan2 ( arg1v , arg -> r ) ; break ; default : error ( " " , FALSE ) ; } arg = newdoub ( ) ; arg -> r = res ; return ( arg ) ; }
although we call this atan, it is really atan2 to the c-world,
that is, it takes two args
although we call this atan it is really atan2 to the c - world that is it takes two args