Re: CHAT: (no subject)
From: | Nik Taylor <yonjuuni@...> |
Date: | Monday, January 12, 2004, 4:17 |
Marty Rosenberg wrote:
>
> Thank you all for the warm welcome. I have several things to say in
> response to everyone, though at the moment, I don't remember who said
> what, and I don't have time to check. Apologies in advance.
>
> First of all, I much appreciate all of the root generation systems.
> They seem very useful. I have one question about them though: How do
> you convert numbers between different bases quickly? I know a very
> long, complicated way to do it which I used for Deniedergy, but that's
> long and complicated.
For integers, it's fairly easy. For example, converting from 10 to 12
(which my conlang uses), let's go with the current year, 2004
First off, it helps to know a series of powers, for example, 12, 144,
1728, etc. If it's too large for an easily-remembered power, see below
Divide by 1728 (the highest power smaller than the number)
The result is 1.15972....
Subtract the 1 (writing it down), and multiply what's left by 12 (1.916
...), write down the integer (1), and multiply the remainder by 12
(11.0), write down the integer (B). Since this is an integer, any
remaining digits are zero
2004 = 11B0
If the number is particularly large, you can simply try dividing by
large powers of 12 (very easy with a scientific calculator) until you
get one that gives you an initial result larger than 1 but smaller than
12, e.g.:
34584363
Divide by 12^5 = 138.9868 ..., clearly too small a power, but you can
see that you're within one order of magnitude, since it's smaller than
144
Divide by 12^6 = 11.5822 ... (B)
Multiply remainder by 12 = 6.9867 ... (6)
And so forth just as above
For converting *to* decimal, it's even easier, just multiply by
appropriate powers of the base, e.g., duodecimal 45A3 = 4*12^3 + 5*12^2
+ 10*12 + 3 = 7755
Decimals are a bit tougher, but still pretty easy. Converting from
decimal:
Any integer part convert as above, and then focus on the decimal
This time *multiplying*, for example, .125 in base 12:
Multiply by 12 (1.5) write down the integer (1)
Multiply the remainder by 12 (6), write down the integer
Since it comes out to an integer, you're done. Thus, .125 in base 12 is
.16
Converting *to* decimal, just as above, add and multiply. Duodecimal
.16 = 1/12 + 6/144 = .125
> If I'm not mistaken, no other base can have any form of working
> decimal system.)
Where'd you get that idea? The decimal idea is merely a matter of
powers, a*base^x + b*base^(x-1) ... + m*base + n + o*base^-1 + p*base^-2
... Plug in whatever base you want and it works.
--
"There's no such thing as 'cool'. Everyone's just a big dork or nerd,
you just have to find people who are dorky the same way you are." -
overheard
ICQ: 18656696
AIM Screen-Name: NikTaylor42