How to Increase the Resolution of analogRead()! (from 10-bits up to 21-bits)

Just a comment on the general libary. In my oppinion it is poor because it uses global public variables to communicate.
There should be a call to set the resoloution, and a call that returns a reading. There also should be some way to set what analogue port to use.

Note that the input must remain stable throught the whole reading, if you are measuring an unknown voltage that means it is going to change but it must change at a lower rate than the least significant bit over the reading.

Due to the faulty sample code I have not managed to test any resoloution higher than 16 bits. However as mentioned the resoloution of the floating point variable is going to affect things. Already in the sample code floating point constants are defined that exceed the resoloution of a floating point number. Note that in the arduino float and double are the same size.