functionfindPlace
Find the index next to which the target value fits in the array (requires monotonic array of positive values)
Information
NOTE: Currently only handles montonically increasing, positive array values.
Example:
e = 5.5
v = {1,3,7,9,11}
result = 2 because 5.5 falls between index 2 and 3 of v
Example 2:
e = 3
v = {1,3,7,9,11}
result = 2
Example 3:
e = 12
v = {1,3,7,9,11}
result = 5
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | e | Search for e | |
| Real[:] | v | Real vector |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | result | result=0, if e < v[1], result=size(v,1) if e > v[end] |