BIS fnc findExtreme: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl>" to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma2oa | | arma2oa | ||
|1.00 | |1.00 | ||
|gr1 = Arrays | |gr1 = Arrays | ||
|gr2 = Math | |gr2 = Math | ||
| Returns the minimum or maximum value in an array of numbers. | | Returns the minimum or maximum value in an array of numbers. | ||
| [numbers, mode] call [[BIS_fnc_findExtreme]] | | [numbers, mode] call [[BIS_fnc_findExtreme]] | ||
|p1= numbers: [[Array]] - a set of numbers | |p1= numbers: [[Array]] - a set of numbers | ||
|p2= mode: [[Number]] - 0 (find minimum) or 1 (find maximum) | |p2= mode: [[Number]] - 0 (find minimum) or 1 (find maximum) | ||
| [[Number]] | | [[Number]] | ||
|x1= <code>_result = [<nowiki/>[1,4,5,8,3,7], 1] [[call]] [[BIS_fnc_findExtreme]]; {{codecomment|// returns 8}} | |x1= <code>_result = [<nowiki/>[1,4,5,8,3,7], 1] [[call]] [[BIS_fnc_findExtreme]]; {{codecomment|// returns 8}} | ||
_result = [<nowiki/>[1,4,5,8,3,7], 0] [[call]] [[BIS_fnc_findExtreme]]; {{codecomment|// returns 1}}</code> | _result = [<nowiki/>[1,4,5,8,3,7], 0] [[call]] [[BIS_fnc_findExtreme]]; {{codecomment|// returns 1}}</code> | ||
| [[BIS_fnc_lowestNum]], [[BIS_fnc_greatestNum]], [[selectMin]], [[selectMax]] | | [[BIS_fnc_lowestNum]], [[BIS_fnc_greatestNum]], [[selectMin]], [[selectMax]] | ||
}} | }} | ||
Revision as of 23:00, 17 January 2021
Description
- Description:
- Returns the minimum or maximum value in an array of numbers.
- Execution:
- call
- Groups:
- ArraysMath
Syntax
- Syntax:
- [numbers, mode] call BIS_fnc_findExtreme
- Parameters:
- numbers: Array - a set of numbers
- mode: Number - 0 (find minimum) or 1 (find maximum)
- Return Value:
- Number
Examples
- Example 1:
_result = [[1,4,5,8,3,7], 1] call BIS_fnc_findExtreme; // returns 8 _result = [[1,4,5,8,3,7], 0] call BIS_fnc_findExtreme; // returns 1
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note