Negabinaries
Page 1 of 1
Monoblaine




Posts: 205

PostPosted: Thu, 16th May 2013 11:38    Post subject: Negabinaries
hey folks. I've been looking into negabinaries but I cannot really understand how to convert decimals into that base.

for example 19 in base -2 is 10111

however if i calculate it i get like this

19 / -2 = -9 remainder 1
-9 / -2 = 4 remainder 1
4 / -2 = -2 remainder 0
-2 / -2 = 1 remainder 0
1 / -2 = 0 remainder 1

what am I doing wrong here.
Back to top
Frant
King's Bounty



Posts: 24814
Location: Your Mom
PostPosted: Thu, 16th May 2013 12:17    Post subject:
Wow, first time I've heard about "negabinaries".

EDIT: ah, it's a non-standard positional numeral system. Probably invented by a sadist. Wink


Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!

"The sky was the color of a TV tuned to a dead station" - Neuromancer
Back to top
Monoblaine




Posts: 205

PostPosted: Thu, 16th May 2013 13:06    Post subject:
alright nevermind, figured it out. whenever a remainder is -1 you add +1 to result for example

number 19

19 / -2 = -9 remainder 1
-9 / -2 = 4 remainder -1
4+1 = 5 / -2 = -2 remainder 1
-2 / -2 = 1 remainder 0
1 / -2 = 0 remainder 1

another example

number 87

87 / -2 = -43 remainder 1
-43 / -2 = 21 remainder -1
21+1 = 22 / -2 = -11 remainder 0
-11 / -2 = 5 remainder -1
5+1=6 / -2 = -3 remainder 0
-3 / -2 =1 remainder -1
1+1=2 / -2 = -1 remainder 0
-1 / -2 = 0 remainder -1
0+1=1 / -2 = 0 remainder 1

so 87 decimal = 110101011

hope this helps anyone in future Smile
Back to top
Frant
King's Bounty



Posts: 24814
Location: Your Mom
PostPosted: Thu, 16th May 2013 14:10    Post subject:
See, ignorance in others can actually help you and increase your own understanding of the subject of in this case my ignorance.

Who knew, ignorance leads to knowledge. Razz


Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!

"The sky was the color of a TV tuned to a dead station" - Neuromancer
Back to top
StrEagle




Posts: 14059
Location: Balkans
PostPosted: Thu, 16th May 2013 15:37    Post subject:
who and why would make/use this?


Lutzifer wrote:
and yes, mine is only average
Back to top
The_Zeel




Posts: 14922

PostPosted: Thu, 16th May 2013 15:51    Post subject:
Frant wrote:
Probably invented by a sadist. Wink
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - General chatter
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group