08-13-2003, 06:16 AM
Nope. Imagine a single unsigned array that has an unsigned integer in each array cell. Imagine a 4 elments array. The thing is dealing with that array as a whole number, just appending a number at the end of the latter.
With 1 element, as it is an unsigned integer, you could represent from 0 to 65535. With 2 elements, making an imaginary number appending the two array cells in binary, you would have a number from 0 to 65536*65536-1 (this is what is done to build a long: append two ints). With three array cells, you would have a number from 0 to 65536^3-1. And so forth.
If array[0] = 1001110001011111 and array[1] = 1100101000011100, the library acts as it was a big integer 11001010000111001001110001011111.
All ancient big integer math libraries are done that way.
I entered the BCD stuff just to clarify things, but I messed everything up . What I was comparing to BCD was using strings as numbers like oracle is doing. But BCD is using 4 bits to represent 10 numbers and oracle is using 8 bits, so it is even worse memory-wise.
With 1 element, as it is an unsigned integer, you could represent from 0 to 65535. With 2 elements, making an imaginary number appending the two array cells in binary, you would have a number from 0 to 65536*65536-1 (this is what is done to build a long: append two ints). With three array cells, you would have a number from 0 to 65536^3-1. And so forth.
If array[0] = 1001110001011111 and array[1] = 1100101000011100, the library acts as it was a big integer 11001010000111001001110001011111.
All ancient big integer math libraries are done that way.
I entered the BCD stuff just to clarify things, but I messed everything up . What I was comparing to BCD was using strings as numbers like oracle is doing. But BCD is using 4 bits to represent 10 numbers and oracle is using 8 bits, so it is even worse memory-wise.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i