It's probably not as remarkable as it sounds. :-) The most basic operation - that of doing _3b1202, or suchlike - will happen correctly even if the implementor only ever thinks of positive bases.

You may have noted too that using a negative base in J will accommodate a negative representation, as in _3b_121 = _4, and I do not believe that this is conventional. If it was accepted it should probably mean

+/ 9 _3 1 * _1 2 1 = _14

anyway. But that is maybe leaving up to the user not to be stupid; for example in J601 you can do 2b222, and _5b879.

Arved Sandstrom

[ SNIP ]
Then I thought back to a math competition I was once in, where they
first had a speaker talk about a subject that the competitors
presumably had never been exposed to before, and then had us take a
test on the subject.

The subject of the talk was negative bases. For example base negative
3, where 120 is equal to

1*(-3)^2 + 2*(-3)^1 + 0*(-3)^0 = 3

As an aside, one interesting aspect of negative bases is that you
never need to negate a number. For example, -7 = 1202.

So having discovered that J seemingly handles arbitrary bases, I
tried negative bases, and sure enough, it works:

   _3b1202
_7

_That_ was a pleasant surprise!

regards,

Geoff

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to