@univerjs/core v0.5.0-beta.1 • Docs
Function: binSearchFirstGreaterThanTarget()
function binSearchFirstGreaterThanTarget(arr, target): number
Return the index of the last index in an ascending array which value is just greater than the target. If there is no value greater than the target, return arr.length - 1.
Alternatively, you can consider inserting a number to ensure the array remains sorted, and return the position for insertion.
Parameters
Parameter | Type |
---|---|
arr | number [] |
target | number |
Returns
number
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/array-search.ts:105