Dami said:
I applied +1 and -1 to AN3 and AN2 of the PIC which defines the range for the ADC
Try reading the datasheets, +1V is below the permitted range for VRef+, and -1V is also too low for VRef-. It's all explained in the DC characteristics at the back of the datasheets. You won't be getting anything like accurate readings like this, you should scale the inputs using an opamp, and use references from 0V to a 2.5V precision reference source (or even the 5V supply would be more accurate than what you've got).
You're also not thinking clearly about the figures themselves, you suggested:
int array1[]={1,1,1,1,1} instead of float array1[]={1.34,1.43,1.21,1.17,1.06]}.
I would write that as:
int array1[]={134,143,121,117,106} instead of float array1[]={1.34,1.43,1.21,1.17,1.06]}.
This keeps the numbers integer and accurate (and MUCH faster - probably 100 times faster?).
A quick multiplication check with Windows calculator gives:
2.8755302004
Using integers gives:
28755302004
All you need to do is insert the decimal point in the correct place to give the final exact result. The floating version, while fully accurate (in this example) using Windows calculator, most probably won't be in practice.
BTW, I used multiply to demonstrate the inaccuracies of floating point - which rather failed as Windows calculator performed better than I thought :lol: