So why 32767? Seems kinda random. It's a Computer Science thing. It's how numbers (and information in general) is stored in your computer.
Forgive me if some of this is wrong (it's been awhile since I studied this):
Basic integers (or ints) are stored as a 16-digit binary number in your computer, a.k.a 16 bits. For example:
0000000000000010 = the decimal number 2
0000000000001010 = the decimal number 10
0100000000000000 = the decimal number 16384
The first digit in the 16-digit string signifies if the number is positive (0) or negative (1).
So, if you're only dealing with positive numbers (such as a count of number of reads, which we're doing here), you only have 15 binary digits to play with: 0 101010101010101 (one 0 followed by 15 binary digits), where the first digit (the separate 0) means the entire number is positive.
So 2^15 = 32768
ie. 32768 possibilities of making a 15-digit number of 1's and 0's.
Another way of seeing it is: you have 16 binary digits. So you can make:
2^16 = 65536 different numbers
But you have to divide in half, because half your numbers are positive, and half are negative:
65536 / 2 = 32768 positive numbers
Finally, you have to minus 1, because the number 0111111111111111 represents positive infinity (this is the iffy part I don't remember - is this true? Someone correct me if it's not).
So really, you only have 32768 - 1 = 32767 positive numbers that can be made from 16 binary digits.
I'm guessing this is now fixed because, instead of using int (basic integers), he can use a "long" (larger integers) or something. Thus the count can now be much, much higher if need be.
Any questions?
BlueWizard's blog: The Rambling Corner
HEDWIG: "The road is my home. In reflecting upon the people whom I have come upon in my travels, I cannot help but think of the people who have come upon me."
Updated On: 8/24/04 at 09:24 PM