d2jsp
Log InRegister
d2jsp Forums > d2jsp > General Help > General Help Archive > Signed Decimal To Hexadecimal
Add Reply New Topic New Poll
Member
Posts: 2,392
Joined: May 15 2010
Gold: 1.01
Aug 24 2011 10:31pm
How would i convert -26 into a 16-bithexadecimal number?

I know the answer is FFE6 but how?

edit: nvm got it, had to add 11 0's

This post was edited by JimmmyBoy on Aug 24 2011 10:45pm
Member
Posts: 25,450
Joined: Sep 22 2007
Gold: Locked
Trader: Scammer
Aug 24 2011 10:34pm
-32:
1. Represent 32 in binary, 00100000
2. Reverse the bits, 11011111
3. Add 1, 11100000
4. Represent the resulting binary in hex, E0
Member
Posts: 2,392
Joined: May 15 2010
Gold: 1.01
Aug 24 2011 10:36pm
Quote (Archmage @ Aug 24 2011 09:34pm)
-32:
1. Represent 32 in binary, 00100000
2. Reverse the bits, 11011111
3. Add 1, 11100000
4. Represent the resulting binary in hex, E0


32 in binary is 100000 O.o

This post was edited by JimmmyBoy on Aug 24 2011 10:36pm
Member
Posts: 25,450
Joined: Sep 22 2007
Gold: Locked
Trader: Scammer
Aug 24 2011 10:37pm
32 = 0b100000

Which I guess is 00100000

E/ Idk anything about binary codes, honestly.

But okay, try doing those steps without the 00's

This post was edited by Archmage on Aug 24 2011 10:38pm
Member
Posts: 2,392
Joined: May 15 2010
Gold: 1.01
Aug 24 2011 10:38pm
Quote (Archmage @ Aug 24 2011 09:37pm)
32 = 0b100000

Which I guess is 00100000


nvm i see. the 2 zeros were added to make it 8 digits
Member
Posts: 25,450
Joined: Sep 22 2007
Gold: Locked
Trader: Scammer
Aug 24 2011 10:39pm
Quote (JimmmyBoy @ Aug 25 2011 12:38am)
nvm i see. the 2 zeros were added to make it 8 digits


Ah okay :) Well that makes sense.

Hope it helped.
Member
Posts: 2,392
Joined: May 15 2010
Gold: 1.01
Aug 24 2011 10:41pm
Quote (Archmage @ Aug 24 2011 09:39pm)
Ah okay :) Well that makes sense.

Hope it helped.


ya it did thanks


This post was edited by JimmmyBoy on Aug 24 2011 10:43pm
Go Back To General Help Archive Topic List
Add Reply New Topic New Poll