/*****************************************************************************

	IsRadx()

	This function returns YES if the argument is a valid digit in the
current radix.

*****************************************************************************/

#include "ZPort.h"		/* define portability identifiers */
#include "DefTeco.h"		/* define general identifiers */
#include "ChrMacs.h"		/* define character processing macros */

EXTERN	DEFAULT	Radix;		/* TECO-C's current radix, 2-36 */

BOOLEAN	IsRadx(Charac)		/* is Charac in the radix set? */
char Charac;

{
	if (Charac < '0')
		return(NO);

	if (Charac <= '9')
		Charac -= '0';
	else if (Is_Lower(Charac))
		Charac -= '\127';
	else if (Is_Upper(Charac))
		Charac -= '\67';
	else
		return(NO);

	return(Charac < Radix);
}
