Hoppa till huvudinnehåll

//ERDDAP/com.cohort.util/ScriptMath2/binaryFindFirstGAE

binaryFindFirstGAE

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

Find the first element which is >x or almostEqual(precision, 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 first element which is >= x in an ascending sorted array. If x <the smallest element, this returns 0. If x >the largest element, this returns dar.length (no element is appropriate). If x is NaN, this is currently undefined.

Parameters​

JVM

daran ascending sorted double[] which currently may not have duplicate values
x
precisione.g., 5 for floats and 9 for doubles