Converting negative indices into positive. In the code for computing the integral negative index is ignored.