unaryMinus
@ExperimentalSince(version = KotoolsTypesVersion.V4_4_0)
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")
Content copied to clipboard
Please note that this function is not available yet for Java users.