I am trying to display the temperature of a temp probe using an LCD and a PIC16F690. The probe can measure temps from -40F to 185F. The output from the temp probe is from 0.5 to 4.5V, respectively accross the temp span. I am trying to display the temp based on the analog input but I'm having some problems figuring out how to do this. I am using a 10-bit conversion with a 5V reference, so each bit is worth 0.004883 volts.

The equation that I came up with was
((Analog_value - 0.5V)/ (0.004883V))-40 = temp (in F)

The problem is that I can not multiply or divide decimal fractions in a PIC, atleast I don't know how to.

One solution I thought of doing was disregarding the temps below 0 F. I can just display (temp below 0F). I could then take the voltage point where it is above 0 F and then add decimal fraction between 2 points (0.275) and display this number. So from my calculations, an analog value of 1.2109 V will create a digital value of 248. I can state that this is 0F and then add 0.275 * (new digital value X - digital value 248) to create the new values of temp.

I am also allowing the user to have different things happen at different voltages and will need to convert 0 to 185 F into a value that will relate to A to D reading.

I am also low on memory space.

Do anyone have an ideas that might help? Thanks.