[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

In a sorted integer list FindSorted Fails if there is more than one instance of value!


I am not sure I understand how array.findSorted should work, but it appears to never find the first instance of a value in a sorted list when there is more than one instance of the value, seems to be random. Should it not be returning the first instance of the value, the same as find does? At least intuitively that seems to be the correct answer, and should not the negative number be the last instance of the value or the first not sure which for inserting...

It looks like if there lets say 17 entries it return the third instance position, skips first two.

Using integer[] anyway which is what i have tested. find does in fact work correctly.

--
~~~~ Brian

Attachment: OpenPGP_0x78BFB26402F48419.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


Follow-Ups:
Re: In a sorted integer list FindSorted Fails if there is more than one instance of value!Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>