Skip to content

Commit 8331f41

Browse files
authored
Add float op comment
1 parent 41f0506 commit 8331f41

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugins/include/sorting.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ native void SortCustom1D(any[] array, int array_size, SortFunc1D sortfunc, any d
118118
* @return -1 if first should go before second
119119
* 0 if first is equal to second
120120
* 1 if first should go after second
121+
*
122+
* @note If working with float arrays and arithmatic operators, elements must be retagged
123+
* through assignment or with view_as<float> to ensure floating point operations are
124+
* performed rather than integer operations.
125+
* for example: float f = elem1[index]; if (view_as<float>(elem2[index]) < f) /* ... */
121126
*/
122127
typedef SortFunc2D = function int (any[] elem1, any[] elem2, const any[][] array, any data);
123128

0 commit comments

Comments
 (0)