Thank you Haraviik, I already knew the impossibility of applying such a predicate as “$0 == 3” and I actually couldn’t quite figure out a solution. Honestly, I’m quite new to Swift :)
Actually at first I thought that no one would use it, as the same result could be achieved using the main binarySearch function. If the elements to be matched have to be equal it makes no difference whether we retrieve the smallest or greatest, unless the array had multiple entries with same value. In that case, you are right, my functions do not work properly, but your code seems to be working fine in these situations! Would you want to cooperate for the proposal? Lorenzo Racca +39 345 9294756 lorenzo.ra...@live.it _______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution