do (double)(i+1) instead of (double)i + 1