Different bases of integers

Hello everyone, this is still the longbow

We often hear that programmers must understand binary

                                

  So what is binary?

decimal

Before we talk about binary, let's talk about a decimal system that we commonly use, that is, "ten million"

The addition, subtraction, multiplication and division we learn is based on decimal, such as 4+3=7, 9+8=17.

9+8 means every decimal one, which is the essence of decimal.

As the name suggests, binary is every two into one.

binary

Therefore, corresponding to "ten million" in decimal, binary is "0 2 4 8 16" , which is a power function of 2.

For example, the binary representation of 7 is 111, and the binary representation of 155 is 10011011

 

Octal and Hexadecimal

They are every octal and every hexadecimal, but there is a problem here. The maximum number of decimal units we commonly use is up to 9. How to represent the last few digits of hexadecimal?

It is stipulated to use ABCDEF to represent the last few digits, so if we represent 155 in octal and hexadecimal, respectively.

Octal: 233

Hex: 9b

 

Today's explanation is here

Later, we will discuss the conversion between bases in detail.

see you later

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324319713&siteId=291194637