MAX: maximum of scalar arguments, or of array (f)
⇒Home
⇒Contents
⇒more on Programming
(⇒Optional Keywords Syntax)
⇒ Example of a MAX call in "Greatest_element_of_a_list" (RosettaCode)
Bookmarks:
⇒maximum value
MAX returns the
maximum value
of the scalar arguments or the array argument:
result = MAX( x, y, z, ...)
! x, y, z are numeric scalars, e.g.:
largest = MAX( 4, -3.1,
EXP
(1) )
! sets largest to 4
REAL
:: vec(5)
vec =
RAN
( 100, 10)
! e.g. 96.00351636 90.99435447 108.1637875 91.95317195 90.80626762
result = MAX(vec)
! set to 108.1637875
MAXLOC
is to find the
location of the maximum
, e.g.:
loc = MAXLOC( vec )
! is set to 3
analogous functions are
MIN
and
MINLOC
How your donation will be used, and how to get a HicEst key code in return
©2000-2010 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.
Impressum