Given an input array, outputs an array containing the rank from [1, input.length] corresponding to each element. Ties are dealt with by averaging. This function does not reorder the input range. Return type is float by default, but if you are sure you have no ties, ints can be used for efficiency (in which case ties will not be averaged), and if you need more precision when averaging ties, you can use double or real.
Works with any input range.