You are here: Symbol Reference > AbstractMtxVec Namespace > Classes > TMtxVec Class > public > BinarySearch Method > TMtxVec.BinarySearch Method (double)
MtxVec VCL
ContentsIndex
PreviousUpNext
TMtxVec.BinarySearch Method (double)

Finds a match for X in sorted object values using binary search.

Pascal
function BinarySearch(const x: double): Integer; overload;

the index of last matched element. If no matching elements are found, the result is -1.

The data in the vector must be sorted in ascending order for this function to work correctly.

Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!