2018-10-13 21:30:51 Conversion of number systems

Source: Internet
Author: User

2018-10-13 21:30:51 C language

Binary, octal, and 16-in: 1) Integral parts

Decimal integers are converted to n-ary integers using the "n-remainder, reverse-order" method.

Decimal number 36926 converted to octal?

110076

2) Number of decimal parts

Decimal decimals are converted into n decimal fractions using the "multiply N rounding, ordered" method.

Decimal decimal 0.930908203125 converted to octal decimals?

0.7345

If a number contains both an integer part and a fractional part, then separate the integer and fractional parts, complete the conversion according to the method above, and then merge together.

Note: When you convert decimal decimals to other decimal fractions, the result may be an infinite number of decimal places.

Example: 0.51

Summary: Other conversions into decimal---------------------------> Add by Weights, decimal to other binary---------------------------------> integer part (except N, In reverse order), fractional parts (multiply N rounded, ordered), if this decimal contains fractional and integral portions, the results of the two operations are added.

2018-10-13 21:30:51 Conversion of number systems

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.