Link Search Menu Expand Document

rank

Explanation Finds the order of the specified data .
Call format var r = rank ( specified data , order , range )
Return value Rank within the specified data range
Behavior changed since Ver.5.0.2, Mobile Ver.4.5.0, AI Ver 1.0.2->
Returns -1 if not found in the data
Arguments Date or Number specified data Data for ranking
Number order 0: Descending order 1: Ascending order
Date or Number range Array object name
Exception None
Example of use
var arr = new Number [20];
for (var n = 0; n <arr.Length; n ++) {
arr [n] = int (rand () * 10);
print (arr [n], "");
}
print (" The value of arr [0] is " + str (arr [0]) + " . The rank is " + str (rank (arr [0], 0, arr)) + " rank ¥ n");
Related item