Vicon Shogun banner

Description

Sorts a list of floating point numbers stored in an array.

Functional area

System

Command syntax

Syntax

sortFloats floatArray [-d]

Arguments

NameTypeRequiredComments
floatArrayfloat arrayyesThe array to sort

Flags

NameFlag argumentsArgument typeExclusive toComments
d0Sorts in descending order. Default is to sort in ascending order.

Return value

float array

Returns the sorted array.

Examples

// Demonstrate a simple sort.
float $array[3];
$array[0] = 1.0;
$array[1] = -1.5;
$array[2] = 1e-6;
float $sortedArray[] = `sortFloats $array`;
print $sortedArray;

Additional information

Related commands