Documentation for /Users/balarsen/Documents/idl/larsen/

Generated by IDLdoc

single page | use frames     summary     class     fields     routine details     file attributes

./

locate.pro

toplocate

data search

result = locate(array, value)

perform a search or a sorted array for the value you want

Only tested on int, float, and double

Return value

the array index of the value closest to 'value'

Parameters

array in required

the sorted array to search

value in required

the value to search for

Examples

IDL> a=findgen(10000) IDL> print, locate(a, 30) 30.5176 IDL> print, a[30.5176] 30.0000

Author information

History:

Tue May 3 17:14:53 2005, Brian Larsen written from NR in C 2nd edition

Statistics

Lines: 23
McCabe complexity:

File attributes

Modifcation date: Tue Sep 9 13:55:49 2008
Lines: 65
Disclaimer