BIS fnc sortNum: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Add sort link)
m (Some wiki formatting)
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function
____________________________________________________________________________________________


|arma2|Game name=
|game1= arma2
|version1= 1.00


|1.00|Game version=
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


|Sorts an array of numbers from lowest (left) to highest (right). The passed array is modified by reference.
|game3= tkoh
This function uses the quick sort algorithm.
|version3= 1.00


{{Feature arma3| If you do not need the return value, use [[sort]] instead.}}|DESCRIPTION=
|game4= arma3
____________________________________________________________________________________________
|version4= 0.50


|array call [[BIS_fnc_sortNum]]|SYNTAX=
|gr1= Arrays


|p1= array: [[Array]] - Array of numbers.|PARAMETER1=
|descr= 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.


|[[Array]] - Sorted array|RETURNVALUE=
{{Feature|arma3|If you do not need the return value, use [[sort]] instead.}}
____________________________________________________________________________________________


|x1= <code>[5,9,987,6,97,8,6] [[call]] [[BIS_fnc_sortNum]]; {{codecomment|// Returns [5,6,6,8,9,97,987]}}</code> |EXAMPLE1=
|s1= array call [[BIS_fnc_sortNum]]
____________________________________________________________________________________________


|[[sort]], [[BIS_fnc_randomInt]] [[BIS_fnc_geometricMean]] [[BIS_fnc_arithmeticMean]] [[BIS_fnc_nearestNum]] [[BIS_fnc_roundNum]]|SEEALSO=
|p1= array: [[Array]] of [[Number]]s
}}


|r1= [[Array]] - sorted array


<h3 style="display:none">Notes</h3>
|x1= <sqf>[5,9,987,6,97,8,6] call BIS_fnc_sortNum; // returns [5,6,6,8,9,97,987]</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|seealso= [[sort]] [[BIS_fnc_randomInt]] [[BIS_fnc_geometricMean]] [[BIS_fnc_arithmeticMean]] [[BIS_fnc_nearestNum]] [[BIS_fnc_roundNum]]
</dl>
}}
 
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Numbers|{{uc:sortNum}}]]
[[Category:Functions|{{uc:sortNum}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:sortNum}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:sortNum}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:sortNum}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:sortNum}}]]

Latest revision as of 18:02, 30 June 2022

Hover & click on the images for description

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.
Arma 3
If you do not need the return value, use sort instead.
Execution:
call
Groups:
Arrays

Syntax

Syntax:
array call BIS_fnc_sortNum
Parameters:
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:
sort BIS_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