1.6 KiB
Preface
Primitive Data Types
Null
This value type can override any other type and essentially means "nothing" not even 0, its the lack of a value whatsoever
If you open a box thats supposed to have a number in it, and you found null, the box would just be empty
Boolean
A boolean value is true or false, it cannot be anything else
See Sqlite for more information on boolean values within sqlite.
Integer
An integer is any valid number without a decimal, such as 1, 5, 68, 421, and even negative numbers like -42, -99999, or -0 in some cases
Real Number (floating point number)
A real number is any real number, such as 1, 73, 45, 0.6, 255, -9.8, 200000000, and so on, it may use a decimal value unlike integers.
We should prefer Integers over Real Numbers unless a decimal place is absolutely required:
There are resolution limitations to consider, the number of bits a computer can store in a single value is finite, a 32 bit number only has 32 bits, meaning there can only be about 2 billion and some possible combinations.
Real numbers do not change this, there are only 2 billion or so different values to a real number, so the smaller you go, the more likely you are to accidentally "snap" to a nearby number that can actually be stored,
The same thing happens when you go high enough.
Here are some good videos on the topic.
Simple Computerphile
Technical Spanning Tree
Complex Data Types
Users
- UID: Integer
- isDeveloper: Boolean