aboutsummaryrefslogtreecommitdiff
path: root/src/benchmarks/cfrac/pcvt.h
blob: e2dd7247029db30073abe83ac341040ca6e58bb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Machine dependent file used for conversion routines
 *   (e.g. atop, ptoa, itop, ptoi, etc)
 */

/* 
 * For pXtop:  (X = {i,u,l,ul,d})
 */
#define	INTSIZE	  	2	/* floor(log[Base](2*(MAXINT+1))) */
#define	LONGSIZE	2	/* floor(log[Base](2*(MAXLONG+1))) */
#define	DOUBLESIZE  	129	/* double precision size = log[base](HUGE) */

/*
 * For ptoX
 */
#define MAXINT	  	(int)  ((unsigned int)  ~0 >> 1)
#define MAXLONG	  	(long) ((unsigned long) ~0 >> 1)
#define MAXUNSIGNED	(~ (unsigned int)  0)
#define MAXUNSIGNEDLONG	(~ (unsigned long) 0L)

#define MAXACC	  	(~ (accumulator)   0)

/*
 * aBase - Ascii base (ptoa)
 * There are aDigits Ascii digits per precision digit, pDigits.
 * At least one of { aDigits, pDigits } <= (MAXINT / the maximum posit value).
 */
#define	aDigits		525	/* aDigits/pDigits >~= log[aBase](Base) */
#define pDigits		109	/* 525/109=4.8165>log[10](65536)=4.816479931 */
#define	aBase		 10	/* string conversion base */
#define aDigit	 1000000000	/* must be power of aBase < MAXINT */
#define aDigitLog	  9	/* log[aBase] of aDigit */