Numbers Flashcards
1
Q
How big is a Byte number?
A
8-bit signed integer
2
Q
How big is a Short number?
A
16-bit signed integer
3
Q
How big is a Int number?
A
32-bit signed integer
4
Q
How big is a Long number?
A
64-bit signed integer
5
Q
What is a Float number?
A
A 32-bit floating point number.
6
Q
What is a Double number?
A
A 64-bit floating point number.
7
Q
What class do all numbers extend?
A
All numbers in Kotlin are object and they extend the Number class.
8
Q
What can we use instead of Modulo?
A
Primitive.rem() (Remainder)
9
Q
What can all subclasses of Number do?
A
Be converted to any other Number sub-type or Char.
10
Q
How can we make long numbers more readable?
A
Use underscores. E.g. 1_000_000