Hexedecimal Why?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Hexedecimal Why?

Post by qw »

You could use a base-1 numeral system. It's able to represent one value only: zero. A base-0 numeral system is left as an exercise to the reader :D
Last edited by qw on Wed Jun 05, 2013 4:36 am, edited 1 time in total.
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Hexedecimal Why?

Post by iansjack »

Actually, a base-1 number system can represent any positive number. It cannot represent zero (other than by the lack of any mark, which is a bit ambiguous). It's one of the oldest number systems known.

Base-0 would not be particularly useful.
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Hexedecimal Why?

Post by qw »

A base-k numeral system has digits for 0 .. k-1. As a consequence, a base-1 numeral system only has the digit 0 and can only represent the value zero.
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Hexedecimal Why?

Post by iansjack »

I have learnt better than to argue with people's mathematical misconceptions on this forum. Too many self-taught "mathematicians".

http://www.princeton.edu/~achaney/tmve/ ... ystem.html
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Hexedecimal Why?

Post by qw »

You probably missed the ":D" at the end of my post. I was pushing the discussion to the absurd. I'm aware of the unary numeral system, but programming languages usually don't support tallying. After all, we don't tally in base-10 either.
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Hexedecimal Why?

Post by iansjack »

Hobbes wrote:programming languages usually don't support tallying. After all, we don't tally in base-10 either.
I disagree.
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Hexedecimal Why?

Post by qw »

Yes, I noticed.
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Hexedecimal Why?

Post by Owen »

Negative bases also exist, as do complex bases
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Hexedecimal Why?

Post by qw »

Hey, that's cool.

I recall there is some binary representation where every odd bit is positive and every even bit is negative:

0000: 0
0001: 1
0010: -2
0011: -1
0100: 4
0101: 5
0110: 2
0111: 3
1000: -8
1001: -7
1010: -10
1011: -9
1100: -4
1101: -3
1110: -6
1111: -5

Though I don't really see the benefits over two-complement.

EDIT: I see I got my calculations wrong. Never mind, the idea is clear.
Last edited by qw on Mon Jun 10, 2013 5:06 am, edited 1 time in total.
rdos
Member
Member
Posts: 3306
Joined: Wed Oct 01, 2008 1:55 pm

Re: Hexedecimal Why?

Post by rdos »

I vote for e (natural logarithm, 2.71828) as the natural selection of a base. :mrgreen:
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: Hexedecimal Why?

Post by Kazinsal »

Hexadecimal can represent a byte in two clear digits, and each byte in any size of 8-bit-byte-based word can be recognized clearly at a glance with hexadecimal. You can't do that with decimal, octal, ternary...
Post Reply