How can I separate a decimal number into round hexadecimals in Python?

-2

Is there a way that I can separate a decimal into however many unique "round" hexadecimals make it up?

For example: 1048576 decimal goes into 0x01000000

But.. 1048577 although technically 0x01000001, I'd like to be able to break it into 0x01000000 and 0x00000001

1311232 is hex 0x00140200 which breaks into 0x00000200, 0x00400000 & 0x01000000

python
python-3.x
hex
asked on Stack Overflow Aug 20, 2020 by adrian • edited Aug 20, 2020 by 10 Rep

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0