Displaying temperature and pressure at the same time using java

AWOL:

long a =1023 - analogRead(analogPin);

If analogRead returns 1013.

So if the analog read of the thermistor gives 1013 the code will have some kind of error, right? Do you guys then think that I should change the code? Because that equation was really the best that I found to display the temperature in degrees celsius