Analog input not allowing full 1024 bits

It's just for rounding. Imagine you added up 100 numbers and got 9999. Printing out "9999/100" would print 99 since the C/C++ language just discards any fractional part in an integer/integer division.

If you first add 50 you get "(9999+50)/100" --> 10049/100 --> 100, which is a lot closer to the "true" answer of 99.99.

So your '1012' number may be artificially low because of rounding as well (although not adding in the 100th sample probably has more effect!)

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons