Why is maximal voltage divided by 1023 and not by 1024 ? Does it not introduce linear error that is 0 when sensorValue = 0 and ( 5.0 / 1024.0 ) when sensorValue = 1023 ?
The maximum reading is 1023. So if you want 5V to read 5V you divide by 1023. If you prefer 5V to read 4.995V then divide by 1024. Zero isn't a problem, if sensorValue = 0 then the result is also 0 (whatever you multiply and divide it by).