Why doesn't UInt have a toDouble()?
This appears to be coming in 1.3.30, according to this YouTrack request.
1.3.30 was just recently tagged and appears to be releasing very shortly.
Is UInt not considered a number type?
Yes, it doesn't extend Number
class.
Declaration of Int
:
class Int : Number, Comparable<Int>
Declaration of UInt
:
inline class UInt : Comparable<UInt>
Starting with Kotlin version 1.3.30 UInt
has toFloat
and toDouble
methods.