-1 is a shortcut index for the final element of an array. $# is the index of the final element of the array. The difference is subtle and important.
Besides that, ranges always increase. You can't go from 0 to -1 by adding one -- at least, not anytime soon. It's a meaningless construct.
In reply to Re: Binary search algorithm
by chromatic
in thread Binary search algorithm
by mjab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |