jeggy
11/10/2022, 5:04 PMfun main() {
val num: Number = 25
println(num > 10)
}
Shouldn't something like this be possible by the stdlib?jw
11/10/2022, 5:43 PMjw
11/10/2022, 5:43 PMNumber
subtype and represent a number outside the valid range of all available conversion functionsjeggy
11/10/2022, 5:45 PMoperator fun Number.compareTo(i: Int) = toLong().compareTo(i.toLong())
operator fun Number.compareTo(i: Long) = toLong().compareTo(i)
I created thesejw
11/10/2022, 5:46 PM0.2 > 0.1
would return falsejw
11/10/2022, 5:47 PMBigInteger
given its longValue()
implementation states:
if this BigInteger is too big to fit in a long, only the low-order 64 bits are returned.
andries.fc
11/15/2022, 8:31 AM