Peter_n:
Nick, what is your verdict ?
First, let's go back to the datasheet:
0x000 represents analog ground, and 0x3FF represents the selected reference voltage minus one LSB.
So (contrary to what you might expect) 0x3FF (ie. 1023) does not claim to represent Vref, but rather the reference voltage minus one bit (which in the case of 5V is 5/1024 = 4.88 mV).
Thus, the fact that dividing 1023/1024 and multiplying by 5 does not give 5 is entirely consistent with the fact that it does not claim to represent Vref.
The datasheet goes on (on the previous page):
Quantization Error: Due to the quantization of the input voltage into a finite number of codes, a range of input voltages (1 LSB wide) will code to the same value. Always ±0.5 LSB.
So there is an expected error of +/- 2.44 mV.
Therefore I agree with Peter_n's formula:
float voltage = ((float) rawADC + 0.5 ) / 1024.0 * 5.0;