News

In hex, numbers between zero and nine are represented as they are in decimal, with number ten using the letter A, then 11 as B and so on up to F, which is 15. The 12 is therefore C in hexadecimal.
Learn how to use Windows Calculator to convert Decimal to Binary in Windows 11/10. ... You will see Hex (Hexadecimal), Dec (Decimal), Oct (Octal) and Bin (Binary) radio buttons.
Let's take the example further, and convert each hexadecimal digit to its decimal equivalent and then add them: (16 2 x 1) + (16 0 x 15) + (16 0 x 4) = (256 + 240 + 4) = 500. Hex and binary in action.
To convert a number from decimal to hexadecimal, you can use a printf command like the one below that converts decimal 15 to hexadecimal: $ printf ‘%xn’ 15 f ...
Example - convert decimal 22 to hexadecimal. 16 goes into 22 once with 6 left over, so 22 ÷ 16 = 1 remainder 6. 1 = hex 1. 6 = hex 6. Result - 16. Example - convert 138 to hexadecimal.
Useful (particularly since expr and $(( )) can't work with floats and decimal values), but where this gets really interesting is with those input and output numeric bases. Let's say I want to confirm ...