If your reference voltage is 1.8V, then it's fine.
Instead of using float values, why don't you use integers? If you need single decimal place accuracy (nearest 0.1V), you can use this:
Code:
data = ADC_Read(0); // adc read at AN0
data = (data/1023)*18; //1.8 is my maximum value
if (data > 5) { "DO SOMETHING"; }
else {DO NOTHING}
So, 18 means 1.8V, 5 means 0.5V. Then, you avoid using float values. The code is more efficient and executed quicker.
If all you need to do is compare for 0.5V, you can avoid converting to "5" or "0.5" as well. Compare against the value you'd obtain from the ADC with 0.5V input.
Hope this helps.
Tahmid.