I am having a bit of trouble with inserting this math equation into code that runs my aquarium's temperature clock.
Here is the equation:
y = -2.889464633·10-16 x7 + 1.281707352·10-12 x6 - 2.403703125·10-9 x5 + 2.469756623·10-6 x4 - 1.500907849·10-3 x3 + 5.393125117·10-1 x2 - 105.9879341 x + 8790.689453
(note this is the exact regression equation. I round the decimals to the 3 decimal points in my code)
This is the code I used (V is the voltage read by the themistor) :
T = (-2.889 * pow(10, -16)) * pow(V, 7) + ( 1.282 * pow(10, -12)) * pow(V, 6) - ...
When I compile and run, the data I get is severely truncated. Is there a better way to write this polynomial?
Your help is very much appreciated.