Kotlin is a statically typed programming language with basic data types support such as
Numbers can be stored in type of
|Type||Allocated memory size|
Suppose you need to store 3.14 and the Euler’s number, than you can store it in a Float and in a Double.
Notice the “f” after 3.14. Kotlin, by default, interprest floating point numbers as Doubles, which have higher precision compared to Floats.
To declare a Float literal, you should explicitly tell the compiler that your value is Float by adding “f” at the end of the value.
In case if oyu need more precise result use Double insted of Float.