Home > Common Problem > body text

What is the number of digits in a decimal number?

青灯夜游
Release: 2020-08-31 17:19:34
Original
24089 people have browsed it

What is the number of digits in a decimal number?

#In computer numerical values, there are three concepts that must be mastered: number, base number, and bit weight.

  • Number: Different numerical symbols that represent the size of basic numerical values ​​in a number system. There are 10 digits in the decimal system: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

  • Base: The number of digits used in a numerical value. The base of binary is 2 and the base of decimal is 10.

  • Bit weight: The size of the value represented by a 1 on a certain bit in a value. For example: decimal 345, the position weight of 3 is 100, the position weight of 3 is 10, the position weight of 4 is 10, the position weight of 5 is 1

Expand according to the weight, the first weight is 10^0, the second bit is 10^1... and so on, the Nth bit is 10^(N-1), the value of this number is equal to the value of each bit * the sum of the corresponding weights of the bit.

Computers can only recognize binary numbers, but people are familiar with decimal numbers and are not used to using binary numbers. Therefore, when computers input and output data, decimal numbers are often used. The difference is that the decimal numbers here are represented by binary encoding. There are ten digits in a decimal number, and four binary digits are needed to represent a decimal number, but it is still "every tenth", so it is called a binary coded decimal number, or a binary coded decimal number, or BCD for short. (Binary coded Decimal) code.

For more related knowledge, please visit: PHP Chinese website!

The above is the detailed content of What is the number of digits in a decimal number?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!