Base representation is also done with #. and #:

But the inverse of #. and antibase #: don't work
as expected:

   0.1 #. 1 2 3
3.21
   0.1 #.^:_1] 3.21

   0.1 0.1 0.1 #: 3.21
0 0 0.01
   0.1 0.1 0.1 #. 0 0 0.01
0.01

   _3 #. 1 2 0 2
_7
   _3 #.^:_1] _7
_1 _1
   _3 _3 _3 _3 #: _7
0 _1 _1 _1
   _3 _3 _3 _3 #. 0 _1 _1 _1
_7
   

--- Arved Sandstrom <[EMAIL PROTECTED]> wrote:

> 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
> 



       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. 
Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to