BIS fnc sortNum: 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 | ||
|arma2 | |arma2 | ||
|1.00 | |1.00 | ||
|gr1 = Arrays | |gr1 = Arrays | ||
|Sorts an array of numbers from lowest (left) to highest (right). The passed array is modified by reference. | |Sorts an array of numbers from lowest (left) to highest (right). The passed array is modified by reference. | ||
This function uses the quick sort algorithm. | This function uses the quick sort algorithm. | ||
{{Feature|arma3| If you do not need the return value, use [[sort]] instead.}} | {{Feature|arma3| If you do not need the return value, use [[sort]] instead.}} | ||
|array call [[BIS_fnc_sortNum]] | |array call [[BIS_fnc_sortNum]] | ||
|p1= array: [[Array]] - Array of numbers. | |p1= array: [[Array]] - Array of numbers. | ||
|[[Array]] - Sorted array | |[[Array]] - Sorted array | ||
|x1= <code>[5,9,987,6,97,8,6] [[call]] [[BIS_fnc_sortNum]]; {{codecomment|// Returns [5,6,6,8,9,97,987]}}</code> | |x1= <code>[5,9,987,6,97,8,6] [[call]] [[BIS_fnc_sortNum]]; {{codecomment|// Returns [5,6,6,8,9,97,987]}}</code> | ||
|[[sort]], [[BIS_fnc_randomInt]] [[BIS_fnc_geometricMean]] [[BIS_fnc_arithmeticMean]] [[BIS_fnc_nearestNum]] [[BIS_fnc_roundNum]] | |[[sort]], [[BIS_fnc_randomInt]] [[BIS_fnc_geometricMean]] [[BIS_fnc_arithmeticMean]] [[BIS_fnc_nearestNum]] [[BIS_fnc_roundNum]] | ||
}} | }} | ||
Revision as of 23:48, 17 January 2021
Description
- Description:
- Sorts an array of numbers from lowest (left) to highest (right). The passed array is modified by reference. This function uses the quick sort algorithm.
- Execution:
- call
- Groups:
- Arrays
Syntax
- Syntax:
- array call BIS_fnc_sortNum
- Parameters:
- array: Array - Array of numbers.
- Return Value:
- Array - Sorted array
Examples
- Example 1:
[5,9,987,6,97,8,6] call BIS_fnc_sortNum; // Returns [5,6,6,8,9,97,987]
Additional Information
- See also:
- sortBIS_fnc_randomInt BIS_fnc_geometricMean BIS_fnc_arithmeticMean BIS_fnc_nearestNum BIS_fnc_roundNum
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