CUDA Program Issue

I have a question about CUDA program.

When converting the following CPU program into CUDA code,

■CPU
for (int i = -100; i <= 100; i++) {
array[i] = ((y* i ) * (exp(x / i) - 1) / (exp(x / i) + 1)) + 0.5);
}

■GPU(CUDA)
int idx = blockIdx.x * blockDim.x + threadIdx.x;
if (idx >=100) return;
array[idx] = ((y * idx) * (exp(x / idx) - 1)/(exp(x / idx) + 1)) + 0.5);

In this program, idx counts up from 0. How can I write it to count up from -100?

int idx = blockIdx.x * blockDim.x + threadIdx.x - 100;
if (idx >=100) return;
array[idx] = ((y * idx) * (exp(x / idx) - 1)/(exp(x / idx) + 1)) + 0.5);

> 100

(was already wrong in the CUDA version of the OP)