Home  >  Article  >  How to convert decimal to hexadecimal

How to convert decimal to hexadecimal

尚
Original
2019-06-11 10:48:15284421browse

How to convert decimal to hexadecimal

1. How to convert decimal to hexadecimal:

Convert decimal to hexadecimal by multiplying For sixteen rounds, just multiply the corresponding base number each time and then take the integer part of the result. It should be noted that not all decimal decimals can be completely converted into hexadecimal decimals, in which case approximate values ​​are required.

Example: Convert 0.9032D into hexadecimal decimal

  • ##0.9032*16=14.4512 Take the integer 14, which is E

  • 0.4512 *16=7.2192 Take the integer 7

  • 0.2192*16=3.5072 Take the integer 3

  • 0.5072*16=8.1152 Take the integer 8

  • 0.1152*16=1.8432 Take the integer 1

So this number converted to hexadecimal is 0.E7381H

2. Convert decimal to decimal in other bases:

The method to convert decimal to other base is the same as the method to convert to hexadecimal.


Convert a decimal decimal to an R decimal by multiplying by R to round. Each time you multiply by the corresponding base, take the integer part of the result. It should be noted that not all decimal decimals can be completely converted into R-based decimals. In this case, approximations are needed.

Related recommendations:

How to convert hexadecimal to decimal

The above is the detailed content of How to convert decimal to hexadecimal. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:what is plcNext article:what is plc