Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jan 2001 17:11:58 -0600 (CST)
From:      Mike Meyer <mwm@mired.org>
To:        Salvo Bartolotta <bartequi@inwind.it>
Cc:        Mike Meyer <mwm@mired.org>, freebsd-chat@freebsd.org
Subject:   Re: OT again: Re: hexidecimal literacy
Message-ID:  <14963.21950.110019.468965@guru.mired.org>
In-Reply-To: <20010127.22394200@bartequi.ottodomain.org>
References:  <14963.8033.752142.149320@guru.mired.org> <20010127.20140200@bartequi.ottodomain.org> <14963.13797.116165.382738@guru.mired.org> <20010127.22394200@bartequi.ottodomain.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Salvo Bartolotta <bartequi@inwind.it> types:
> [ redirected to -chat before somebody flames both of us :-) ]

Good idea!

> >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
> > > > > I thought I understood it before, but looking at it like this
> > > > > simplifies it dramaticly!!
> > > > Just remember that this applies to interesting bases like 0, 1, Pi and
> > > > negative numbers :-).
> > > Hmm, I am afraid you are exaggerating a bit :-)
> > Actually, I'm not. I'm pretty sure this was from Knuth, back when I
> > was an undergrad. Unfortunately, my books are all in storage, so I
> > can't check on it :-(.
> <yet more nit-picking :-)>

I would call it teaching your mother to suck eggs, but...

> > You seem to be focused on generating N. If that's the goal, then using
> > negative (or any base less than 2) or irrational bases is indeed
> > problematical. However, that doesn't change the fact that a string in
> > some base has a single, fixed value even for negative and
> > transcendental bases. As such, they can be safely used to represent
> > numbers, and make a perfectly valid base.
> Yup (except for 0 and 1). Possible but ackward/impractical. Either you 
> use positive and/or negative coefficients to express a given integer, 
> or transcendental coefficients. This recalls somehow to mind a vector 
> space of dimension 1.

Nope, only 0 is exempt. Unary is usually the first notational systems
ones learns for representing numbers, and is almost certainly the
first one discovered by humanity. It's probably used by more people
than binary.

It does have some strange properties. For instance, you have to use
the base as a digit - otherwise you only get 0, which is very
inconvenient. Also, since one raised to any power is 1, position is
irrelevant. This means you don't even needs 0s.

But you can represent any integer N by a string of N 1s, which is it's
unary representation. This was the representation used by the original
unix bc for an output base of 1. Setting obase to 0 caused it to use
string of bell characters instead of 1s. I have to wonder if the bc
authors would be interested in patches for that?

Now, if you want to get *really* wierd, start thinking about bases
that have an absolute value of less than 1.


	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14963.21950.110019.468965>