sum(temp/intchl) -> sum(temp)/intchl means that you divide sum of all values by sum of mean values. Lets write it in detail:
sum(temp) = x1 + x2 + x3 + ... + x(n-1) + x(n)
intchl = (x1+x2)/2 + (x2 + x3)/2 + ... + (x(n-2) + x(n-1)/2 + (x(n-1) + xn)/2 = x1/2 + x2 + x3 + .... + x(n-1) + xn/2 = sum(temp) - (temp(1) + temp(end))/2
It means that intchl is lower than sum(temp).
I think you should to calculate intchl as sum(temp).