/* BigNum.h - Types and structures for clients of BigNum */
 
#ifndef BIGNUM←H
#define BIGNUM←H
 
#include "bignumtypes.h"
#ifdef C←VERSION

typedef unsigned short	BigNumDigit;	/* A single BigNum digit */
#else
typedef unsigned int 	BigNumDigit;	/* A single BigNum digit */
#endif 

typedef unsigned int 	BigNumType;	/* A BigNum's type */
typedef unsigned int	BigNumCarry;	/* Either 0 or 1 */
typedef BigNumDigit * 	BigNum;		/* The entity seen by the user */

#define BN←BYTE←SIZE	8	/* Number of bits in a byte */

#define BN←DIGIT←SIZE	(sizeof(BigNumDigit) * BN←BYTE←SIZE)
			/* Each word of a BigNum is stored as an 
		    	   unsigned BN←DIGIT←SIZE-bit integer */

#ifdef LL←VERSION
#define BN←WORD←SIZE    15
#else
#define BN←WORD←SIZE	(sizeof(int) * BN←BYTE←SIZE)
			/* BN←WORD←SIZE is the number of bits in an 
			   ordinary "int" in the target language */
#endif

/* Declarations of routines returning non-int's */
BigNum BnAlloc(), BnCreate();
BigNumType BnGetType();
Boolean BnDoesDigitFitInWord(), BnIsDigitZero(), BnIsDigitNormalized();
Boolean BnIsDigitOdd(), BnIsZero();
Sign BnCompareDigits(), BnCompare();
BigNumCarry BnAddCarry(), BnAdd(), BnSubtractBorrow(), BnSubtract();
BigNumCarry BnMultiplyDigit(), BnMultiply();
 
#endif BIGNUM←H