dir.by  
  Search  
Programming, development, testing
Kotlin
Decimal numbers in Kotlin are: Float, Double
  Looked at 1980 times    
 Decimal numbers in Kotlin are: Float, Double 
last updated: 15 January 2025
Example: Double
  Kotlin  
val myPrice:Double = 14.2 // val означает что НЕ МОЖЕМ менять переменную потом
var myWeight:Double = 65.3 // var означает что можем менять переменную потом
How much space do they take:
Type
min ... max value range
Amount of memory occupied
   Example
Float
-3.4 * 1038 ... 3.4 * 1038
Decimal precision: 7 digits
4 bytes
  Kotlin  
var myPrice:Float = 14.2f
Double
-1.8 * 10308 ... 1.8 * 10308
decimal precision: 16 digits
8 bytes
  Kotlin  
var myPrice:Double = 14.2
 
← Previous topic
Integer numbers in Kotlin are: Byte, UByte, Short, UShort, Int, UInt, Long, ULong
 
Next topic →
A flag with values of true or false in Kotlin is: Boolean
 
Your feedback ... Comments ...
   
Your Name
Your comment (www links can only be added by a logged-in user)

  Объявления  
  Объявления  
 
What is Kotlin?
Why is IntelliJ IDEA the most popular development environment for Kotlin?
Download and install IntelliJ IDEA to explore Kotlin
Create a new project in IntelliJ IDEA for study Kotlin
Int, Float, Boolean, Char ...
Integer numbers in Kotlin are: Byte, UByte, Short, UShort, Int, UInt, Long, ULong
Decimal numbers in Kotlin are: Float, Double
A flag with values of true or false in Kotlin is: Boolean
The symbol in Kotlin is: Char
Convert number to text in Kotlin | Int → String
String
The string, the text in Kotlin is: String
Interpolate strings in Kotlin. Example: val address:String = "${street}, ${country}"
What is the difference between String and StringBuilder ?
Enum
What is an enumeration (enum) in Kotlin ?
How do I find enum by value in Kotlin ?
Class
What is class in Kotlin? Example: class MyBook { ... }
lateinit is a late initialization for the class field | Kotlin
class that inherits from interface in Kotlin | Example: class MyBook : IBook { ...}
Unnamed class that inherits from interface in Kotlin | Example: val book1 = object : IBook { ...}
Generic, template class in Kotlin | Example: class MyBook<T> { ... }
Collections and Arrays
Create collections list, set, map and an array array in Kotlin
null
null value, use the symbol ? and ?. and !! and ?: and !!. and ?. in Kotlin
Lambda function
Lambda function in Kotlin. Example 1: var myFunc1 : (a:Int, b:Int) -> Int = { p1, p2 -> p1 + p2 };

  Ваши вопросы присылайте по почте: info@dir.by  
Яндекс.Метрика