nding or truncation, or throws <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html">IllegalArgumentException</a> if this number is <a href="-strictly-positive-int/index.html">strictly positive</a>.</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">var result: NegativeInt = (-1).toNegativeIntOrThrow()<br>println(result) // -1<br><br>result = 0.toNegativeIntOrThrow()<br>println(result) // 0<br><br>1.toNegativeIntOrThrow() // Ille