diff options
author | Jakob Kaivo <jkk@ung.org> | 2022-03-28 15:46:27 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2022-03-28 15:46:27 -0400 |
commit | 427349ba1556a2efb131ee05f4f3752e35d06957 (patch) | |
tree | e6dcc0f527f5071b8c3e84346521b843a9b21cbd /big.h | |
parent | 5a2c4e97e922720bdf86661a28268fa87b57bddd (diff) |
move big.c internal constants to big.c
Diffstat (limited to 'big.h')
-rw-r--r-- | big.h | 22 |
1 files changed, 6 insertions, 16 deletions
@@ -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 */ |