Helper function for interpreting negative array indexes as counting from the end of the array (just like Python).
non-negative integer
if negative, count from the end of the array; otherwise, pass-through