/
sortFloats
sortFloats
Description
Sorts a list of floating point numbers stored in an array.
Functional area
System
Command syntax
Syntax
sortFloats floatArray [-d] |
Arguments
Name | Type | Required | Comments |
---|---|---|---|
floatArray | float array | yes | The array to sort |
Flags
Name | Flag arguments | Argument type | Exclusive to | Comments |
---|---|---|---|---|
d | 0 | — | — | Sorts 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
, multiple selections available,
Related content
sortStrings
sortStrings
More like this
writeFloat
writeFloat
More like this
fabs
More like this
abs
More like this
abs
More like this
cos
More like this