You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got this when I initialize IntervalTree with a bad value (actually, the max value I intented to have in the tree).
When initializing with the medium value (max-min)/2, it was ok
When the midpoint of intervals was calculated by bit shifting (prior to f7166f0), the error that @brycehanscomb encountered was due to the fact, when bit shifting, Java considers integers to be in a 32-bit signed representation. 1,073,741,824 + 1,073,741,825 = 2,147,483,648, which is greater than the largest 32-bit signed integer, 2,147,483,647. Thus 1073741824 + 1073741825 >> 1 gives the wrong answer because it wraps around to a negative number.
@fredericgermain, by the time you looked at this, you were seeing a different problem that was due to a typo in the new code for finding the interval midpoints. PR #11 should resolve this. And using / 2 instead of >> 1 to divide by 2 means that the full allowable range of integers can be used.
The following line produces a RangeError:
The exact error in Chrome is:
The text was updated successfully, but these errors were encountered: