Tks, JJ :)

Found only a small issue. Whenever the searching number is bigger or equal to the last one on the table it should return the last one and not 2 before.

For example, i gave a try with only 10 numbers to search:

Table = 101, 103, 107, 109, 113, 127, 131, 137, 139, 149

*(So, the Index/Pos = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)*Number is smaller or equal to the 1st one is ok

Ex:

Number to Search = 100. Return nearest number is 101. (So, index = 0) OK !!

Number to Search = 101. Return nearest number is 101. (So, index = 0) OK !!

Numbers in between are Ok

Number to Search = 104. Return nearest number is 103. (So, index = 1) OK !!

Number is equal,is ok only when it is not the last one. Ex:

Number to Search = 103. Return index = 1 OK !!

Number to Search = 139. Return index = 8 OK !!

But....

Number to Search = 149. Not found. Return index should be 9.

but...when Number is bigger or equal to the last, it is returning 2 positions backwards and not the last one

Number to Search = 149. Not finding the proper number. Is giving a message of nearest The correct should be 149. So, index (Pos from 0 to XX) = 9

Number to Search = 150. Return nearest number is 139. The correct should be 149. So, index (Pos from 0 to XX) = 9

Number to Search = 151. Return nearest number is 139. The correct should be 149 So, index = 9

Number to Search = 2751. Return nearest number is 139. The correct should be 149 So, index = 9