Maximum (FloatNamedArraylist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
Line 18: Line 18:
   
   
==Usage notes==
==Usage notes==
<ul><li>If <var class="term">itemFunction</var> returns <var>String</var> or <var>Unicode</var> values, <var>Maximum</var> uses the collating sequence of EBCDIC or Unicode, respectively, to determine which item has the greatest value. If <var class="term">itemFunction</var> returns a numeric type, numeric comparisons are used. See the second [[Maximum (NamedArraylist function)#Examples|"example"]] for the <var>NamedArraylist</var> <var>Maximum</var> function.
<ul>
<li>If <var class="term">itemFunction</var> returns <var>String</var> or <var>Unicode</var> values, <var>Maximum</var> uses the collating sequence of EBCDIC or Unicode, respectively, to determine which item has the greatest value. If <var class="term">itemFunction</var> returns a numeric type, numeric comparisons are used. See the second [[Maximum (NamedArraylist function)#Examples|"example"]] for the <var>NamedArraylist</var> <var>Maximum</var> function.
 
<li>If the values returned by <var class="term">itemFunction</var> for two or more <var>FloatNamedArraylist</var> items are equal, maximum, values, <var>Maximum</var> returns the (numeric) name of that item which is closest to the beginning of the <var>FloatNamedArraylist</var>.
<li>If the values returned by <var class="term">itemFunction</var> for two or more <var>FloatNamedArraylist</var> items are equal, maximum, values, <var>Maximum</var> returns the (numeric) name of that item which is closest to the beginning of the <var>FloatNamedArraylist</var>.
<li>The parameter for <var>Maximum</var> is a method value, not a <var class="product">User Language</var> expression. That is, you cannot provide a function that itself has an argument (say, <var>[[ToIntegerPower and ToPower (Float functions)|ToIntegerPower]]</var>(2)) as the <var>Maximum</var> parameter.  The [[Maximum (Arraylist function)#Maximum and Minimum with local method|"Maximum and Minimum with local method"]] example shows a way to apply <var>[[ToIntegerPower and ToPower (Float functions)|ToIntegerPower]]</var> with <var>Maximum</var>.
 
<li>The parameter for <var>Maximum</var> is a method value, not a <var class="product">User Language</var> expression. That is, you cannot provide a function that itself has an argument (say, <code>ToIntegerPower(2)</code>) as the <var>Maximum</var> parameter.  The [[Maximum (Arraylist function)#Maximum and Minimum with local method|"Maximum and Minimum with local method"]] example shows a way to apply <var>[[ToIntegerPower and ToPower (Float functions)|ToIntegerPower]]</var> with <var>Maximum</var>.
 
<li><var>Maximum</var> is available in <var class="product">[[Sirius Mods|Sirius Mods]]</var> Version 7.3 and later.
<li><var>Maximum</var> is available in <var class="product">[[Sirius Mods|Sirius Mods]]</var> Version 7.3 and later.
</ul>
</ul>
 
==Examples==
==Examples==
For examples of <var>Maximum</var> (and <var>Minimum</var>) calls, see the [[Minimum (FloatNamedArraylist function)#Examples|"FloatNamedArraylist Minimum function example"]] in
For examples of <var>Maximum</var> (and <var>Minimum</var>) calls, see the [[Minimum (FloatNamedArraylist function)#Examples|"FloatNamedArraylist Minimum function example"]] in

Latest revision as of 20:30, 1 November 2012

Name of item with maximum value or maximum value of function applied to items (FloatNamedArraylist class)


Maximum returns the (numeric) name of the FloatNamedArraylist item that has the maximum value as returned by a specified function. The function applied to each FloatNamedArraylist item, which you specify with the required itemFunction argument, must be a method that operates on the item type and returns a User Language intrinsic datatype (Float, String, or Unicode) value.

Syntax

%number = fltNal:Maximum[( [itemFunction])]

Syntax terms

%number A numeric variable to contain the name of the item in the indicated FloatNamedArraylist that has the maximum value as returned by the argument function.
fltNal A FloatNamedArraylist object.
itemFunction A method value (a method name literal, a method variable, or even a method that returns a method value) that operates on objects of the type specified on the fltNal declaration and that returns an intrinsic value.

As of Sirius Mods Version 7.6, the special identity function, This, is the default itemFunction value for the Maximum and Minimum methods. See "Using the This function as the Maximum parameter" for more information.

Usage notes

  • If itemFunction returns String or Unicode values, Maximum uses the collating sequence of EBCDIC or Unicode, respectively, to determine which item has the greatest value. If itemFunction returns a numeric type, numeric comparisons are used. See the second "example" for the NamedArraylist Maximum function.
  • If the values returned by itemFunction for two or more FloatNamedArraylist items are equal, maximum, values, Maximum returns the (numeric) name of that item which is closest to the beginning of the FloatNamedArraylist.
  • The parameter for Maximum is a method value, not a User Language expression. That is, you cannot provide a function that itself has an argument (say, ToIntegerPower(2)) as the Maximum parameter. The "Maximum and Minimum with local method" example shows a way to apply ToIntegerPower with Maximum.
  • Maximum is available in Sirius Mods Version 7.3 and later.

Examples

For examples of Maximum (and Minimum) calls, see the "FloatNamedArraylist Minimum function example" in the Minimum method description, and "Finding collection maxima and minima, and sorting", and the "NamedArraylist Maximum function example".

See also

  • Minimum is the opposite of the Maximum function.