Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
In article <328A0DE2.11F@lanl.gov>, Dot Delapp <ddelapp@lanl.gov> writes: > Is there a routine similar to the fortran and c min max functions > that returns the max or min of two numbers? > You don't need a routine. Given two numbers, a and b, the statement c = a > b gives the max of the two, while c = a < b gives the min. Mati Meron | "When you argue with a fool, meron@cars.uchicago.edu | chances are he is doing just the same"
Dot Delapp wrote: > > Is there a routine similar to the fortran and c min max functions > that returns the max or min of two numbers? > > Thanks Sure! IDL> a = 40 IDL> b = 45 IDL> print, min([a,b]), max([a,b]) 40 45 -- Andrew F. Loughe afl@cdc.noaa.gov University of Colorado, CIRES http://cdc.noaa.gov/~afl Campus Box 449 phn:(303)492-0707 fax:(303)497-7013 Boulder, CO 80309-0449 "He who laughs last thinks slowest!"
Dot Delapp wrote: > > Is there a routine similar to the fortran and c min max functions > that returns the max or min of two numbers? > > Thanks For two or more separate numbers, you can use < and > for min/max Examples: > print, 1< 2 1 > print, 22 < 1.5 < 3 < 6 < 7 1.5 > temp = 1 > 3 > 2 > print, temp 3 There's more under "Miminum Operator" and "Maximum Operator" in the IDL manuals. Hope this helps Tim