Is there any reason why Kotlin chooses Double as d...
# announcements
k
Is there any reason why Kotlin chooses Double as default type for decimals over Float?
c
1) Because Kotlin is strongly inspired by Java, and Java uses Doubles for decimal literals 2) are there any other modern languages that use Float by default instead of Double? I can’t think of any off the top of my head
t
IMHO, the only advantage for using Float over Double is that they use 2 times less memory. But you may prefer precise calculations to using less memory, even when running on a basic Android phone with 1 Go of RAM.
c
That amount of memory would be negligible for most applications. It’s much more practical to assume that large numbers are a more likely problem than running out of memory on todays computers.
b
python calls it float, but it is double
k
No, they're both floating point, the 32 bit/64 bits versions are called single and double precision.