This is part of the HicEst documentation
MAX: Maximum of Scalar Arguments, or of an Array
The MAX function finds the maximum value of an array, while MAXLOC finds its position.
⇾Home
⇾Contents
⇾more Programming
⇾ Examples
Bookmarks:
⇾maximum_value
MAX returns the
maximum_value
of
scalar arguments or of an 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
a character string:
MAX("Hello World")
! returns 114 ==
ICHAR
("r")
MAXLOC
is to find the
location of the maximum
, e.g.:
loc =
MAXLOC
( vec )
! is set to 3
analogous functions are
MIN
and
MINLOC
⇾
Support HicEst
⇾
Impressum
©2000-2019 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.