Thread.dispatchUncaughtException is being thrown, but I don't have any threads
<p>I'm getting this error dispatchUncaughtException and I have no idea what that means, googling has been less than effective in answering what it is.  I consistently get it on the first run through of some code I wrote for a recursive interpolation search.</p>

<pre><code>public static int interpolationSearch(int[] array, int target) {
    if (array.length &lt; 4)
        return sequentialSearch(array, target);
    else {
        long numLeft = target - array[0];
        long numRight = array.length - 1;
        long numerator = numLeft * numRight;
        long denominator = array[array.length - 1] - array[0];
        int i = (int) Math.floor(numerator / denominator);
        //int i = (int)Math.floor(((target - array[0])*(array.length - 1))/(array[array.length - 1] - array[0]));
        if (target == array[i]) //center point is answer
            return i;
        if (target &lt; array[i]) //recurse on left side
            return interpolationSearch(Arrays.copyOfRange(array, 0, i),
                    target);
        //recurse on right side
        return i
                + interpolationSearch(
                        Arrays.copyOfRange(array, i, array.length), target);
    }
}
</code></pre>

<p>Any idea what's causing this error and how to fix it?  I've noticed that I'm consistently getting 0 for i which it shouldn't be by my calculations every time that it happens.</p>

<p>EDIT: Okay, so now I'm only getting an IndexOutOfBoundsException.  Although I didn't actually change anything so I'm kind of confused.  Somehow the math is coming out wrong although I don't know how.  If you know what the logic error is, please tell me, otherwise I'll just have to work it out.  I know what the deal is with this exception.</p>
