[MUSIC] In this video, we'll find out how the integers actually work in computers. Remember that the problem was export numbers. Of course, let's have Let's start with high precision, while other with very low. Let's take a look at some arbitrary zero, non zero values. Written as binary fraction, either infinite or infinite. In the beginning there are among zeros. Then, that is the first 1 0 digits, which is one because each digit is either 0 or 1. The zeros in the beginning aren't important, they're just zeros. The first 1 is important, but it will always be 1 as there are no other digits. And the digits, which followed the first one, actually defines our number. So the key idea is let's store some fixed number of digits after the first one. The digits are most valuable in defining our own number. But starting onto them is not sufficient. We also need to know the position of the first one because otherwise we will treat values differing by the power of 2 as equal. So in fact because the number in the form 1 point some digits times 2 to some power as multiplication by 2 is just shift of the binary fraction to the left. The power is just the position of 1, considering the position of points as 0. So for example, we could say that we always start in eight digits after the first 1. And in four digits more, we store the position of the first 1. In that way we can store any fraction from 1 point eight 0's to 1 point eight 1's with any shift from minus 8 to 7. The largest value is in fraction is all 1's and the shift to 7. So, it's nearly 2 to the 8. The minimum positive value is when the fraction is 1 and 0s and the shift is minus 8. So it's 2 to the minus 8. As any number is rounded to 9 first digits, 8 is taught explicitly and the first is always 1. So the error is no greater than two to the minus nine. Let's see how arithmetic operations are performed with values of this form. Say you want to sum these two values. First, as they have different shifts, we need to align them. So the point is at the same position in both numbers. After that, you can add them and store the results as we always do. We store the eight digits after the first one and the position of that one. Note that as we keep only eight digits, the tale of this model could get rounded. And some digits of it could even not have a result at all. But that is fine, as we always keep in eight most important digits. In this example the result is substantially larger than the smaller term. Now, do the multiplication. It's somewhat simpler, as we could separately multiple the fractions and get the result in the form 1 point some digits. And supplement apply the powers of 2, which is just ordinal exponents or shifts. Of course, the product will have more than nine digits, that's the first one. That is fine as we just round them as always, while still keeping the eight most important digits. Note there can be another flaw by multiplying such numbers. We always take eight first digits. But there could be overflow in exponents as we just cited for the integers. And to the the fours in point numbers which is the computers. All of course they have more than 12 bits. The most popular type level has 64 bits. It's called double and it's also on Java and it's also the standard type in Python. Out of this 64 bits, 52 are the fraction which is digits this after first one, 11 of an exponent and 1 is assigned it as we also like to store negative values. So the whole number will be -1 to the power of the sign bit, times 1 point digits we just taught as fraction, times 2 to the power of the integer that distort and allowed this exponents. Now let's make properties of this type. The maximum volume is about two to the tenths, which is about ten to the 309ths, and that is quite symmetrical. The minimum positive value is about minus ten to the 309ths. And the cool thing is it's very fit strange for the small space. If one of the stores at range in a fixed point number, we would need to store 2 to the 11th bits instead of just 64. Our is that now we're storing only in exponents. And let us explain. Of course we only get so many digits as stored, and that is 53 binary digits, or about 16 decimals. So you are to of rounding is about two to the minus fifty thirds, or about 10 to the minus sixteenth. Well, we've learned how floating point numbers, and particularly a double work. But where we should and shouldn't use them, and how to not let errors spoil everything, we'll find out in the next video.