Numbers are just the numeric values like:
1 23 4534 3.23 -34, 53 0 -0.42
Let’s start off with a quiz.
What is the bit pattern if given a number?
Here you need to understand how binary bit patterns work. This is basically the reverse quiz of a previous article on what are bits in programming I’ve made here so check it out for some pretty basic practice examples.
By the way, whole numbers are also known as integers.
Basically, we understand that you want to read binary bits from right to left increasing by a factor of 2. So the first bit on the right is equal to 1, while the one to the left of it is 2, and to the left of that is 4, then 16, then 32, and so on until it reaches the 8th bit which is equal to 128.
The answer is:
This is exactly equal to the number 11 because 8 + 2 + 1 = 11.
These 0s and 1s are actually stored in the computer’s memory.
Out of the 18 quintillion bits, within that, includes negative numbers with 1 bit that represents the negative sign. There’re also bits that represent the decimal sign. So realistically, the actual amount of whole numbers really only makes up about 9 quadrillions.
Normal decimal numbers are written just like in math. Check out the example below.
123.23 12.3 9.04 -39.40 -0.10
If the number is huge, you can use the e for the exponent then follow by the actual power such as so:
This is basically the same as 4.123 x 10^3 which is equal to:
It turns out fractional numbers (not whole numbers) are not precise compared to whole number integers.