Allan Adler writes:
> I think radixes in Maxima can only go up to 36, i.e. 10 digits
> and 26 letters. At any rate, it doesn't go up to 60, which means
> that there is no way to do sexaguesimal arithmetic, which I would
> actually like to do.
>
> What would be wrong with an arbitrary base b in which digits are
> numbers are 0,1,...,b-1 written in base 10 and included in some
> delimiter such as parentheses?
Makes sense to me. As it stands, the easy part is the
input parsing -- e.g.
matchfix ("%60", "@")$ matchfix ("@", "%60")$
%60 [L] @ := block ([n: length (L)], m: makelist (60^(n-i-1), i, 0,
n-1), apply ("+", m*L));
@ [L] %60 := block ([n: length (L)], m: makelist (1/60^i, i, 1, n),
apply ("+", m*L));
%60 7,20,11 @ + @ 11,20,7 %60; ==> 5704816807/216000
However, I don't know how to get 5704816807/216000 displayed
in base 60 notation without an explicit function call.
It seems like what we want here is a new type of object,
which carries the base and list of digits around with it,
and it gets displayed appropriately. Creating a new object
type is easy enough, but how to hook into the display code?
The other part that I haven't addressed here is how to
get base-60 objects to interact with ordinary integers
or rationals. Maybe tellsimp? I'm just guessing here.
Well, sorry I can't be more helpful -- maybe someone else
has some ideas here.
Robert Dodier
__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/