Metropoli BBS
VIEWER: typeget.c MODE: TEXT (ASCII)
/* Copyright (C) 1992 by Thomas Glen Smith.  All Rights Reserved. */
/* typeget APL2 V1.0.0 *************************************************
* Called by disclose.                                                  *
* Determines the proper output APL data type, given two input types.   *
***********************************************************************/
#define INCLUDES APLCB
#include "includes.h"
int typeget(old,new)
int old,new;
{

     if (old == 0) old = new; /* initialize */
     else if (new == APLAPL) old = APLAPL;
     else if (old != new)
          if ((new & APL_NUMERIC) && (old & APL_NUMERIC))
          	if (old == APLCPLX || new == APLCPLX)
               	old = APLCPLX; /* convert to complex */
	          else old = APLNUMB; /* convert to double float */
          else old = APLAPL; /* mixed data types */
     return(old);
}

[ RETURN TO DIRECTORY ]