मुख्य सामग्री पर जाएं

//ERDDAP/com.cohort.util/ScriptMath2/binaryFindLastLE

binaryFindLastLE

[JVM]
open fun binaryFindLastLE(dar: Array<Double>, x: Double): Int

Find the last element which is <= x in an ascending sorted array.

If firstGE >lastLE, there are no matching elements (because the requested range is less than or greater than all the values, or between two adjacent values).

Return​

the index of the last element which is <= x in an ascending sorted array. If x <the smallest element, this returns -1 (no element is appropriate). If x >the largest element, this returns dar.length-1. If x is NaN, this is currently undefined.

Parameters​

JVM

daran ascending sorted double[] which may have duplicate values
x