بنیادی مواد پر مہارت حاصل کریں

//ERDDAP/com.cohort.util/ScriptMath2/binaryFindLastLAE

binaryFindLastLAE

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

Find the last element which is <x or almostEqual(5, 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
precisione.g., 5 for floats and 9 for doubles