The problem of finding an interval and the closest points.
Posted: Sat Nov 08, 2025 2:06 pm
Hi, folks.
I am looking for a better and simpler solution to this problem, as what exists seems unnecessarily complicated and inconvenient to me.
The essence of the task:
There are some control points that are defined in advance and do not change. Next, a specific value is entered that falls exactly within the range of all control points. It will never be outside this range. What interests me in the end ? This is the interval (between which control points) in which the entered value lies.
Thanks in advance!
P.S. Sorry, I forgot to write... all values are whole natural numbers !
I am looking for a better and simpler solution to this problem, as what exists seems unnecessarily complicated and inconvenient to me.
The essence of the task:
There are some control points that are defined in advance and do not change. Next, a specific value is entered that falls exactly within the range of all control points. It will never be outside this range. What interests me in the end ? This is the interval (between which control points) in which the entered value lies.
Thanks in advance!
P.S. Sorry, I forgot to write... all values are whole natural numbers !