From 427349ba1556a2efb131ee05f4f3752e35d06957 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Mon, 28 Mar 2022 15:46:27 -0400 Subject: move big.c internal constants to big.c --- big.h | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'big.h') diff --git a/big.h b/big.h index 36d1ba2..d291512 100644 --- a/big.h +++ b/big.h @@ -8,12 +8,11 @@ * Revised to C11 standard and made 64bit compatible, January 2020 * *------------------------------------------------------------------------*/ -#define SIGNBIT 020000000000 - /* most significant bit of 32 bit word */ -#define IBASE 0100000 - /* 2^15 (ie 8^5) so digit is a positive short */ +#define SIGNBIT 020000000000 /* most significant bit of 32 bit word */ +#define IBASE 0100000 /* 2^15 (ie 8^5) so digit is a positive short */ #define MAXDIGIT 077777 #define DIGITWIDTH 15 + #define digit0(x) (hd[x]&MAXDIGIT) #define digit(x) hd[x] #define rest(x) tl[x] @@ -22,10 +21,10 @@ #define bigzero(x) (!digit(x)&&!rest(x)) #define getsmallint(x) (hd[x]&SIGNBIT?-digit0(x):digit(x)) #define stosmallint(x) make(INT,(x)<0?SIGNBIT|(-(x)):(x),0) + long long get_int(word); word sto_int(long long); double bigtodbl(word); -long double bigtoldbl(word); /* not currently used */ double biglog(word); double biglog10(word); int bigcmp(word,word); @@ -46,17 +45,8 @@ word bigxscan(char *,char *); word dbltobig(double); int isnat(word); word strtobig(word,int); -#define force_dbl(x) (tag[x]==INT?bigtodbl(x):get_dbl(x)) -#define PTEN 10000 - /* largest power of ten < IBASE (used by bigscan) */ -#define PSIXTEEN 4096 - /* largest power of sixteen <= IBASE (used by bigtostr) */ -#define PEIGHT 0100000 - /* (=32768) largest power of eight <= IBASE (used by bigtostr) */ -#define TENW 4 - /* number of factors of 10 in PTEN */ -#define OCTW 5 - /* number of factors of 8 in IBASE */ + +#define force_dbl(x) ((tag[(x)] == INT) ? bigtodbl((x)) : get_dbl((x))) /* END OF DEFINITIONS FOR INTEGER PACKAGE */ -- cgit v1.2.1