Richard said:
Elijah Cardon said:
To represent [4096!] in decimal fashion would therefore require
2+3*4095>12 thousand places.
Er, so what? As we've already seen, it is possible to deal with numbers as
large as that in C, if you're prepared or were prepared at some point in
the past to take a little time and effort or to pinch someone else's
library.
Well, this looks like the business part of bignum.h:
#define LITTLENUM_NUMBER_OF_BITS (16)
#define LITTLENUM_RADIX (1 << LITTLENUM_NUMBER_OF_BITS)
#define LITTLENUM_MASK (0xFFFF)
#define LITTLENUM_SHIFT (1)
#define CHARS_PER_LITTLENUM (1 << LITTLENUM_SHIFT)
#ifndef BITS_PER_CHAR
#define BITS_PER_CHAR (8)
#endif
typedef unsigned short LITTLENUM_TYPE;
/* JF truncated this to get around a problem with GCC */
#define LOG_TO_BASE_2_OF_10 (3.3219280948873623478703194294893901758651)
/* WARNING: I haven't checked that the trailing digits are correct! */
/* lengths are in sizeof(littlenum)s */
int bignum_copy (LITTLENUM_TYPE * in, int in_length,
LITTLENUM_TYPE * out, int out_length);
/* end of bignum.h */
It seems to me that this is going after long numbers as opposed to big
numbers. Long numbers are like pi. Borwein and Borwein have an
excellent book on this that I read maybe a decade ago(_Pi and the AGM_).
So if you have pi to 13000 digits and say, "we're just going to remove
the decimal point", then you'd have a big number, but a big number of no
consequence.
I think the way to go is to change the base and represent with entries
in an array. I've never met an interesting number larger than ten to
the fifty-five. Am I right to think that if you have base ten thousand,
then you could represent it in an array of ints that is of length 15? EC