math/
between.pro
top source between
Math
result = between(lowerbound, argument, upperbound, gtstrict=gtstrict, ltstrict=ltstrict)
Determines if the argument lies between the bounds.
Return value
Outputs 1 for any element where Argument is between Lowerbound and Upperbound, and 0 for all other elements. Values equal to Lowerbound and Upperbound return 1 unless overridden by /GTSTRICT and/or /LTSTRICT. Each of the inputs may be either a scalar or an array, but if more than one are arrays then they must have the same numbers of elements.
Parameters
- lowerbound in
Scalar or array of lower bounds.
- argument in
Scalar or array of numerical argument.
- upperbound in
Scalar or array of upper bounds.
Keywords
- gtstrict in
Argument must be strictly greater than Lowerbound, rather than greater or equal to.
- ltstrict in
Argument must be strictly less than Upperbound, rather than less or equal to.
Examples
IDL> print, between(2.5, [0,1,2,3,4], 7.)
0 0 0 1 1
Author information
- History:
Written by: Jeremy Bailin 18 July 2009 Public release in JBIU
File attributes
| Modification date: | Thu Feb 10 10:50:12 2011 |
| Lines: | 67 |
![[attach.png]](../idldoc-resources/attach.png)