# Solved Example of decimal to hexadecimal February 6, 2015 at 13:13:30
Specs: Linux
 An example of decimal to hexadecimalA shortcut method.Two methods.One being less than 255 (Dec).Two being more than 255 (Dec).(1)110 example number <255.110/16 = 6.875 take the whole (6) 6*16 = 96 110 - 96 = 14 (remainder)614 = e (Hex)Combined6e6e (Hex) == 110 (Dec)(2)Example number 555 >255555/16 = 34.687534*16 = 544555 - 544 =11 (remainder)Different step.34/16 = 2 remainder 2Combined= 2211= b (Hex)Combined22b (Hex) == 555 (Dec)message edited by lazybones2 See More: Example of decimal to hexadecimal

#1 February 6, 2015 at 16:25:03
✔ Best Answer
 Not sure what you're asking for, and since you're Linux, this might not help, but here's a batch dhx conversion:::dec-to-hex converter@set hex=@echo off & setlocal enabledelayedexpansionset trimzer=1set test=0123456789ABCDEF(set hexout= )::highest number convertable so far... 16^7-1 (268435455)set /a strt=("1<<24")set xx=%1echo.:aaif %xx% equ 0 goto :xitset /a dig="xx%%16"set hexout=!test:~%dig%,1!%hexout%set /a xx/=16goto :aa:xit:trim off leading zeros unless "flagged" aboveif defined trimzer for /L %%a in (1 1 10) do set hexout=!hexout: 0= !echo %hexout%:: this is best way i know to get externals "over" the endlocal barrierendlocal & set hex=%hexout%

Report •
Related Solutions 