Why из десятичной в любую system (that in binary, that in hexadecimal) number is translated by the method of division, and из любой в десятичную - by another method? How is the decimal system so isolated? After all, from the point of view of mathematics, it should not differ from the same binary and hexadecimal except the alphabet - the set of characters. It always seemed to me that из большей в меньшую translate by the division method, and из меньшей в большую by another method.

  • one
    How else is this? Naturally, all the number systems with a natural base of at least 2 :) are the same. - Harry
  • @Harry, from binary to decimal, we translate by another method, when over each symbol of a number the power of two is written (0, 1, 2), and the resulting numbers obtained by multiplying this degree by the corresponding symbol are added. - nup
  • So what's next? You get a number, which then you need to decompose into tens, hundreds, etc. Only recalculation between numeration systems, where the bases are different degrees of a single number, such as from binary to hexadecimal, is grouped more simply - we group them into 4 bits ... - Harry
  • In the general case, a numerical value is first collected from the record, which is then transferred to another record. The fact that programming languages ​​have a built-in means of displaying a number in decimal notation does not mean that such a conversion is not performed :) - Harry
  • @nup And who's stopping you in the decimal system from subtracting the powers of two from the decimal number starting with the highest and double representation of these degrees is added. and no division. And I'm already silent about the double dabble algorithm ... ways decently - Mike

2 answers 2

If I understand your question correctly, then most likely you have cognitive dissonance :) because you are translating from binary to decimal - well, like, 110101 = 1 + 4 + 16 + 32 = 53 , and you forget that you are already working in decimal . And this is where your conversion is complete.

Let's do it differently - through, say, sevenfold. Then
110101 = 1 + 4 + 22 + 44 = 104

If you worked in the sevenfold notation, you would consider this 104 as the answer and do nothing else. Unless they would ask a question here - and what is the sevenfold number system so outstanding? :)

And now we need 104 to convert to decimal ... Divide 104 by 13 ( 10 in septenary), we get 5 , and in the remainder 3 , we write the total in decimal 53 ...

Is this the answer to your question?

  • Yes, thank you, to some extent the question has cleared up. - nup

The methods are the same and no different.

 12345 dec = 30071 oct 12345 divrem 8 = 1543 1 1543 divrem 8 = 192 7 192 divrem 8 = 24 0 24 divrem 8 = 3 0 3 divrem 8 = 0 3 0o30071 divrem 10 = 0o2322 5 0o2322 divrem 10 = 0o173 4 0o173 divrem 10 = 0o14 3 0o14 divrem 10 = 0o1 2 0o1 divrem 10 = 0o0 1 

The decimal is historically due to 10 fingers.

In general, you can read :)