← Back to context Comment by inigyou 9 hours ago 403 error. What was the bug? 3 comments inigyou Reply fragmede 8 hours ago Load in an incognito window?Loads fine for me:> The bug is in this line:6: int mid =(low + high) / 2; _dain_ 8 hours ago IIRC it was overflow when you do (a + b) / 2 for the midpoint. It took so long to find because you need a >billion item array to overflow the 32-bit integer, and that much RAM wasn't common until the 00s.The right way is a + (b - a)/2. inigyou 5 hours ago 64KiB was common in the 16-bit era, however
fragmede 8 hours ago Load in an incognito window?Loads fine for me:> The bug is in this line:6: int mid =(low + high) / 2;
_dain_ 8 hours ago IIRC it was overflow when you do (a + b) / 2 for the midpoint. It took so long to find because you need a >billion item array to overflow the 32-bit integer, and that much RAM wasn't common until the 00s.The right way is a + (b - a)/2. inigyou 5 hours ago 64KiB was common in the 16-bit era, however
Load in an incognito window?
Loads fine for me:
> The bug is in this line:
6: int mid =(low + high) / 2;
IIRC it was overflow when you do (a + b) / 2 for the midpoint. It took so long to find because you need a >billion item array to overflow the 32-bit integer, and that much RAM wasn't common until the 00s.
The right way is a + (b - a)/2.
64KiB was common in the 16-bit era, however