sign
Returns the sign of the given value Array:
-1.0 if the value is negative,
zero if the value is zero,
1.0 if the value is positive
Example:
arrayOf(-1.0, 2.0, 0.0, -6.0).sign() // [-1.0, 1.0, 0.0, -1.0]
Content copied to clipboard
Since
1.1.0
See also
sign
Returns the sign of the given value Iterable:
-1.0 if the value is negative,
zero if the value is zero,
1.0 if the value is positive
Example:
listOf(-1.0, 2.0, 0.0, -6.0).sign() // [-1.0, 1.0, 0.0, -1.0]
Content copied to clipboard
Since
1.1.0
See also
sign