unaryMinus

@ExperimentalSince(version = KotoolsTypesVersion.V4_4_0)
operator fun StrictlyNegativeInt.unaryMinus(): StrictlyPositiveInt

Returns the negative of this integer number.


Calling from Kotlin

Here's an example of calling this function from Kotlin code:

val number: StrictlyNegativeInt = (-1).toStrictlyNegativeInt()
    .getOrThrow()
val result: StrictlyPositiveInt = -number // or number.unaryMinus()
assertEquals(expected = "1", actual = "$result")

Please note that this function is not available yet for Java users.