Why can't 0.1 be accurately expressed by binary decimal places?

Source: Internet
Author: User

This problem has plagued me for a lot of time. I have a clear understanding recently and want to share it with you.

This problem begins with the digital representation. The decimal number 123 we see today is a natural understanding of its meaning, but do you have any idea about its internal mathematical principles?

The so-called decimal is 0 ~ 9 A numeric notation based on ten basic symbols. A digital notation is a method for arranging a string of basic symbols from left to right consecutively. Why does it mean 12 o'clock, not 21, or a plus two? Because the position of a number is particularly meaningful, the first digit on the rightmost represents a basic number ranging from 0 ~ 9. The second digit does not mean 0 ~ 9, but 0*10 ~ 9*10. By extension, the hundred bits are x * 100 (x is a symbol). The concise mathematical formula is x * 10 ^ k, where the single k is 0, the ten is 1, and the Hundred k is 2, continue from right to left. 123 means 1*10 ^ 2 + 2*10 ^ 1 + 3*10 ^ 0.

The relationship between location, base, and symbol is the internal mathematical principle of the digital representation "123.

So what does 0.1 mean? Is the result of 1*10 ^-1, number to the right. The decimal point is used to distinguish the location of a single digit.

A number must be represented by a digital representation. It must be in the form of x * 10 ^ k, not any number. From the definition of decimal digits, we can know that to be expressed as a number, a number of x * 10 ^ k digits must be expressed in addition to 10, otherwise, it is represented by countless symbols. For example, the number 1/3 divided by 10 equals 1/3*1/10 = 0.0333333 .... Round decimal number.

Which digits can be expressed in decimal format? For example, if the denominator is the sum of 10 Factors and factors, for example, 1, 2, 5, 10, 20, and 50 (the integer denominator is 1, and any number greater than 1 has 1 and itself, therefore, integers can be accurately expressed by any number ).

To answer the question, why can't 0.1 be represented by binary decimal places? 0.1 means that the number of 1/10 must be converted to a binary value, that is, the number of x * 2 ^ k combinations. note that the binary decimal system only has two symbols: 0 and 1. The other one must note that the right shift of the binary divisor is equal to * 2, rather than the 10 decimal system.

1/10*1/2 = 1/20

1*2*2*2*2 = 32 shifted to four places

-20 = 12 vendors 1

12*2 = 24 shifts one digit to the right

-20 = 4 vendors 1

4*2*2*2 = 32 shifted to three places

-20 = 12 Shang 1: The visible number is repeated, and the number of the repeating decimal point is no doubt.

0.00011001.

Which decimal places can be expressed in decimal notation (decimal number, 5/10), because it can be about 1/2, and the denominator is a factor of 2.

To sum up, the location representation has its own defects and cannot represent a large number of rational numbers in a limited number. In this case, you need to use scores to help, to avoid the disadvantage of position representation using a fixed number as the denominator.

If you need a number that can avoid repeating decimals, try the 210 hexadecimal notation, because there are many factors, 2*3*5*7 = 210.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.