binary searches in phobos

Andrey Khropov andkhropov_nosp at m_mtu-net.ru
Thu Dec 7 14:54:00 PST 2006


Karen Lanrap wrote:

> At least the searches in phobos/internal/switch.d fail when the 
> length of the searched list reaches int.max/2, because a signed shift 
> is executed instead of an unsigned shift to compute the new "mid" 
> index for checking.
> 
> Should this considered to be a bug---or as an academic detection 
> only?

It's actually a very famous bug:

http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.
html

-- 
'non-optimal' is a politically correct term for s**t



More information about the Digitalmars-d-learn mailing list