For the More Curious: Unsigned Numbers
Kotlin 1.5 introduced unsigned numeric types as a stable language feature. They are very similar to the numeric types you have seen so far, except that they cannot express negative values. Table 5.2 shows the unsigned numeric types available in Kotlin.
Table 5.2 Unsigned numeric types in Kotlin
|Type||Bits||Max Value||Min Value|
There are similarities and differences between these unsigned numeric types and the signed numeric types introduced earlier in this chapter. For one thing, the floating-point numeric types – Float and Double – have no unsigned counterparts. We ...